{"record":{"id":"60e703dd21711937","repo":"risingwavelabs/risingwave","slug":"should-be-append-only-for-vector-index-writer-but","errorCode":null,"errorMessage":"should be append-only for vector index writer but receive op {:?}","messagePattern":"should be append-only for vector index writer but receive op (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/executor/vector/index_writer.rs","lineNumber":86,"sourceCode":"            .await?;\n\n        while let Some(msg) = input.try_next().await? {\n            match msg {\n                Message::Barrier(barrier) => {\n                    self.vector_writer.flush().await?;\n                    self.vector_writer.seal_current_epoch(\n                        barrier.epoch.curr,\n                        SealCurrentEpochOptions {\n                            table_watermarks: None,\n                            switch_op_consistency_level: None,\n                        },\n                    );\n                    yield Message::Barrier(barrier);\n                }\n                Message::Chunk(chunk) => {\n                    for (op, row) in chunk.rows() {\n                        if op != Op::Insert {\n                            return Err(anyhow!(\n                                \"should be append-only for vector index writer but receive op {:?}\",\n                                op\n                            )\n                            .into());\n                        }\n                        let vector_datum = row.datum_at(0);\n                        let Some(vector_datum) = vector_datum else {\n                            warn!(\n                                ?row,\n                                \"vector index writer received a row with null vector datum, skipping\"\n                            );\n                            continue;\n                        };\n                        let vector = vector_datum.into_vector();\n                        let info = self\n                            .serializer\n                            .serialize(row.project(&info_column_indices))\n                            .into();","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/vector/index_writer.rs#L68-L104","documentation":"The vector index writer only accepts append-only input; each row in an incoming chunk must have op `Insert`. Any Delete or Update op causes `execute_inner` to return this error with the offending op for diagnosis.","triggerScenarios":"A chunk row with `Op::Delete`, `Op::UpdateDelete`, or `Op::UpdateInsert` reaches the vector index writer in `execute_inner`, e.g. an upstream table mutation (UPDATE/DELETE) that must be reflected into the vector index.","commonSituations":"Updating or deleting embeddings after they were written; CDC/upsert sources feeding a vector index; mistaken use of a non-append-only materialized view as the vector index input.","solutions":["Restrict the vector table to INSERT-only writes; model changes as new inserts.","Verify upstream sources are append-only (no upsert CDC configured).","Rebuild the vector index from scratch if historical mutations must be applied."],"exampleFix":"-- before\nDELETE FROM embeddings WHERE id = 1;\n-- after\n-- keep table append-only; filter stale rows at query time or rebuild the index","handlingStrategy":"validation","validationCode":"-- application-side check before writing\n-- only issue INSERT statements against the vector index input table","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure upstream as an append-only source","Model corrections as new inserts, not updates","Filter stale rows at query time rather than deleting them"],"tags":["streaming","vector-index","append-only"],"backgroundTag":"unsupported-operation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}