{"record":{"id":"f6cb3ec5fbfab391","repo":"risingwavelabs/risingwave","slug":"should-not-read-snapshot-from-mockwaitepochstatest","errorCode":null,"errorMessage":"should not read snapshot from MockWaitEpochStateStore","messagePattern":"should not read snapshot from MockWaitEpochStateStore","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/stream/src/executor/dml.rs","lineNumber":517,"sourceCode":"        ) -> StorageResult<()> {\n            if let Some(tx) = self.wait_epoch_called_tx.lock().unwrap().take() {\n                assert!(tx.send((epoch, options)).is_ok());\n            }\n            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        ];","sourceCodeStart":499,"sourceCodeEnd":535,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/dml.rs#L499-L535","documentation":"A deliberate `panic!` in `MockWaitEpochStateStore::new_read_snapshot`. The mock does not provide snapshot reads; it only blocks on epoch-release notifications for DML tests. Requesting a read snapshot means the test reached a read path the mock explicitly does not support.","triggerScenarios":"Calling `StateStore::new_read_snapshot` (any HummockReadEpoch) on a `MockWaitEpochStateStore`, typically when an executor attempts a point/range read during the test.","commonSituations":"A DML executor test where the dataflow actually reads from the state store instead of only waiting for epochs; changing test data flow so batch/stream operators issue snapshot reads against the mock.","solutions":["Use a backing store that supports snapshots (e.g. MemoryStateStore), wrapping the epoch-wait behavior separately if needed.","Redesign the test so no snapshot reads occur while MockWaitEpochStateStore is installed.","Inspect the executor under test to find which operator issues the snapshot read and stub it out."],"exampleFix":"// before\nlet snapshot = mock_store.new_read_snapshot(epoch, opts).await?; // panics\n// after\nlet snapshot = MemoryStateStore::new().new_read_snapshot(epoch, opts).await?;","handlingStrategy":"validation","validationCode":"// verify the dataflow under test never issues snapshot reads\nassert!(\n    !dataflow_performs_snapshot_reads,\n    \"MockWaitEpochStateStore cannot serve snapshot reads\"\n);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use MemoryStateStore for any test where executors read snapshots.","Audit operators in the test pipeline for Hummock read paths before wiring the mock.","Keep epoch-wait and snapshot-read concerns in separate test fixtures."],"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"}