risingwavelabs/risingwave · warning

should not read snapshot from MockWaitEpochStateStore

Error message

should not read snapshot from MockWaitEpochStateStore

What it means

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.

Solutions

  1. Use a backing store that supports snapshots (e.g. MemoryStateStore), wrapping the epoch-wait behavior separately if needed.
  2. Redesign the test so no snapshot reads occur while MockWaitEpochStateStore is installed.
  3. Inspect the executor under test to find which operator issues the snapshot read and stub it out.

Example fix

// before
let snapshot = mock_store.new_read_snapshot(epoch, opts).await?; // panics
// after
let snapshot = MemoryStateStore::new().new_read_snapshot(epoch, opts).await?;
Defensive patterns

Strategy: validation

Validate before calling

// verify the dataflow under test never issues snapshot reads
assert!(
    !dataflow_performs_snapshot_reads,
    "MockWaitEpochStateStore cannot serve snapshot reads"
);

Prevention

When it happens

Trigger: Calling `StateStore::new_read_snapshot` (any HummockReadEpoch) on a `MockWaitEpochStateStore`, typically when an executor attempts a point/range read during the test.

Common situations: 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.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/f6cb3ec5fbfab391. Report an issue: GitHub.

Appendix: source

Thrown at src/stream/src/executor/dml.rs:517

        ) -> StorageResult<()> {
            if let Some(tx) = self.wait_epoch_called_tx.lock().unwrap().take() {
                assert!(tx.send((epoch, options)).is_ok());
            }
            let rx = self.wait_epoch_release_rx.lock().await.take().unwrap();
            rx.await.unwrap();
            Ok(())
        }

        async fn new_local(&self, _option: NewLocalOptions) -> Self::Local {
            panic!("should not create local state from MockWaitEpochStateStore")
        }

        async fn new_read_snapshot(
            &self,
            _epoch: HummockReadEpoch,
            _options: NewReadSnapshotOptions,
        ) -> StorageResult<Self::ReadSnapshot> {
            panic!("should not read snapshot from MockWaitEpochStateStore")
        }

        async fn new_vector_writer(&self, _options: NewVectorWriterOptions) -> Self::VectorWriter {
            panic!("should not create vector writer from MockWaitEpochStateStore")
        }
    }

    #[tokio::test]
    async fn test_dml_executor() {
        let table_id = TableId::default();
        let schema = Schema::new(vec![
            Field::unnamed(DataType::Int64),
            Field::unnamed(DataType::Int64),
        ]);
        let column_descs = vec![
            ColumnDesc::unnamed(ColumnId::new(0), DataType::Int64),
            ColumnDesc::unnamed(ColumnId::new(1), DataType::Int64),
        ];

View on GitHub (pinned to 6469eb736d)