{"record":{"id":"7a24c839e031afdf","repo":"risingwavelabs/risingwave","slug":"updatedelete-operation-is-not-supported-in-appe","errorCode":null,"errorMessage":"`UpdateDelete` operation is not supported in `append_only` mode","messagePattern":"`UpdateDelete` operation is not supported in `append_only` mode","errorType":"validation","errorClass":"SinkError","httpStatus":null,"severity":"error","filePath":"src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_formatter.rs","lineNumber":213,"sourceCode":"                Op::Delete => {\n                    if is_append_only {\n                        return Err(SinkError::ElasticSearchOpenSearch(anyhow!(\n                            \"`Delete` operation is not supported in `append_only` mode\"\n                        )));\n                    }\n                    let key = self.key_encoder.encode(rows)?.into_string()?;\n                    let mem_size_b = std::mem::size_of_val(&key);\n                    result_vec.push(BuildBulkPara {\n                        index: index.to_owned(),\n                        key,\n                        value: None,\n                        mem_size_b,\n                        routing_column,\n                    });\n                }\n                Op::UpdateDelete => {\n                    if is_append_only {\n                        return Err(SinkError::ElasticSearchOpenSearch(anyhow!(\n                            \"`UpdateDelete` operation is not supported in `append_only` mode\"\n                        )));\n                    } else {\n                        let key = self.key_encoder.encode(rows)?.into_string()?;\n                        update_delete_row = Some((key, rows));\n                    }\n                }\n            }\n        }\n        Ok(result_vec)\n    }\n}\n","sourceCodeStart":195,"sourceCodeEnd":226,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/sink/elasticsearch_opensearch/elasticsearch_opensearch_formatter.rs#L195-L226","documentation":"Analogous to the Delete case: in append-only mode the Elasticsearch/OpenSearch formatter cannot handle Op::UpdateDelete rows (the first half of an update). Since append-only streams are assumed never to retract, encountering UpdateDelete violates the contract and conversion fails. The non-append-only branch would instead buffer the row to pair with the following UpdateInsert.","triggerScenarios":"convert_chunk sees Op::UpdateDelete while is_append_only is true — i.e., an append_only sink receives update events from an upsert MV, UPDATE statements, or a changelog source.","commonSituations":"Sink declared append_only but attached to a materialized view with updates, or a Debezium/ changelog source emitting UPDATE events.","solutions":["Remove `append_only = true` from the sink so updates are processed in upsert mode.","Recreate the sink without append_only when the input stream contains updates/retracts.","Use an append-only source (e.g., append-only Kafka topic, no UPDATE semantics) with this sink."],"exampleFix":"-- before\nCREATE SINK s FROM mv WITH (connector='opensearch', append_only=true);\n-- after\nCREATE SINK s FROM mv WITH (connector='opensearch', primary_key='id');","handlingStrategy":"validation","validationCode":"// verify upstream can emit updates before choosing append_only\n// e.g., Debezium changelog sources and updated MVs emit UpdateDelete rows — do not use append_only=true","typeGuard":null,"tryCatchPattern":"match err { SinkError::ElasticSearchOpenSearch(msg) if msg.contains(\"`UpdateDelete` operation is not supported\") => recreate_sink_in_upsert_mode(), _ => return Err(err) }","preventionTips":["Default to upsert mode (with primary_key) for any stream that can update rows.","Reserve append_only=true for pure fact/event streams.","Review upstream source semantics (changelog vs append-only) before sink creation."],"tags":["elasticsearch","sink","append-only","update-delete","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}