{"record":{"id":"49c4f69517e0fbdb","repo":"risingwavelabs/risingwave","slug":"should-not-create-vector-writer-from-mockwaitepoch","errorCode":null,"errorMessage":"should not create vector writer from MockWaitEpochStateStore","messagePattern":"should not create vector writer from MockWaitEpochStateStore","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/stream/src/executor/dml.rs","lineNumber":521,"sourceCode":"            let rx = self.wait_epoch_release_rx.lock().await.take().unwrap();\n            rx.await.unwrap();\n            Ok(())\n        }\n\n        async fn new_local(&self, _option: NewLocalOptions) -> Self::Local {\n            panic!(\"should not create local state from MockWaitEpochStateStore\")\n        }\n\n        async fn new_read_snapshot(\n            &self,\n            _epoch: HummockReadEpoch,\n            _options: NewReadSnapshotOptions,\n        ) -> StorageResult<Self::ReadSnapshot> {\n            panic!(\"should not read snapshot from MockWaitEpochStateStore\")\n        }\n\n        async fn new_vector_writer(&self, _options: NewVectorWriterOptions) -> Self::VectorWriter {\n            panic!(\"should not create vector writer from MockWaitEpochStateStore\")\n        }\n    }\n\n    #[tokio::test]\n    async fn test_dml_executor() {\n        let table_id = TableId::default();\n        let schema = Schema::new(vec![\n            Field::unnamed(DataType::Int64),\n            Field::unnamed(DataType::Int64),\n        ]);\n        let column_descs = vec![\n            ColumnDesc::unnamed(ColumnId::new(0), DataType::Int64),\n            ColumnDesc::unnamed(ColumnId::new(1), DataType::Int64),\n        ];\n        let stream_key = vec![0];\n        let dml_manager = Arc::new(DmlManager::for_test());\n\n        let (mut tx, source) = MockSource::channel();","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/dml.rs#L503-L539","documentation":"A deliberate `panic!` in `MockWaitEpochStateStore::new_vector_writer`. The mock does not implement vector writes; it exists solely to gate progress on epoch releases in DML executor tests. Attempting to create a vector writer means the test writes data through the mock, which is unsupported by design.","triggerScenarios":"Calling `StateStore::new_vector_writer` on a `MockWaitEpochStateStore`, e.g. when a test component tries to ingest data via the vector writer API.","commonSituations":"DML executor test setup that pipelines test rows through a vector writer; newer executor code paths adopting the vector-writer API and being plugged into the legacy mock.","solutions":["Inject test rows via a store that supports writers (e.g. MemoryStateStore) instead of the mock.","Update MockWaitEpochStateStore's test usages if a new code path now requires vector writes.","Restrict the mock to its epoch-wait-only role and move data setup to a real backing store."],"exampleFix":"// before\nlet writer = mock_store.new_vector_writer(opts).await?; // panics\n// after\nlet writer = MemoryStateStore::new().new_vector_writer(opts).await?;","handlingStrategy":"validation","validationCode":"// write test data via a supporting store, not the mock\nlet writer = MemoryStateStore::new().new_vector_writer(opts).await?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never construct writers from mocks; use a real backing store for data setup.","Re-check mock usage when new write APIs (like vector writers) are adopted.","Restrict MockWaitEpochStateStore to gating epoch progress only."],"tags":["test-mock","panic","state-store","unsupported-operation"],"backgroundTag":"method-not-implemented","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"}