David Calavera
08/09/2025, 10:04 PM2025-08-09T22:01:59.333009Z DEBUG slatedb_dst::dst: running step [step_action=Get([36, 100, 0, 60, 109, 236, 246, 248]..., ReadOptions { durability_filter: Remote, dirty: true })]
thread 'test_dst_is_deterministic::case_03' panicked at /home/david/src/slatedb/slatedb-dst/src/dst.rs:614:9:
assertion `left == right` failed: expected_val=Some([20, 185, 203, 249, 32, 104, 84, 23])..., actual_val=None...criccomini
08/09/2025, 10:49 PMcriccomini
08/09/2025, 10:50 PMdirty means now...criccomini
08/09/2025, 10:53 PMRemote is set, dirty is a noop. The read would only see data that's been written to object storage. We don't split a single atomic operation across batches. So I think the issue might simply be that the in-memory "expected state" is reflecting what's been put, but the read is reading against the LocalFilesystem object store, which doesn't contain the most recent writes (that are in the active/imm memtables but not yet flushed to object storage).David Calavera
08/09/2025, 10:59 PMcriccomini
08/09/2025, 11:03 PMDavid Calavera
08/09/2025, 11:09 PMflaneur233
08/10/2025, 1:49 PMRemote persisted data that not committed 😯David Calavera
08/10/2025, 9:07 PMdirty affects the read when DL is remote or not. I left a comment with more data in the PR: https://github.com/slatedb/slatedb/pull/759#issuecomment-3172891685criccomini
08/10/2025, 11:44 PMbatch_write.rs currently appends row-by-row to the WAL buffer, which might flush at any moment. Is this intend behavior? I thought we had the invariant that a single write batch will always be durably written as a single WAL SST (or single L0 SST if WAL is disabled). Without this invariant, we can end up with a single batch being partially written if a failure occurs half way through, right?David Calavera
08/10/2025, 11:59 PMcriccomini
08/11/2025, 12:37 AMwal_buffer.rs (wal enabled) or mem_table_flusher.rs (wal disabled) flushes data before dst.rs calls flush? That data should be visible even if we haven't called flush yet. This leaves a gap in the state exploration (but not technically wrong).criccomini
08/11/2025, 12:38 AMcriccomini
08/11/2025, 12:39 AMDb in a single DstDb or something. That thing should coordinate writes, deletes, and flushes to both the sized tree and the Db so it's easier to keep things in sync. This is mostly just a code cleanliness thing that's been on my mind, but this PR makes me think now's the time to do it.criccomini
08/11/2025, 12:44 AMDavid Calavera
08/11/2025, 12:45 AMDavid Calavera
08/11/2025, 12:48 AMcriccomini
08/11/2025, 12:51 AMcriccomini
08/11/2025, 12:52 AMpub(crate) struct Oracle {
/// is assigned immediately when a write begins, it's possible that the write
/// has not been committed or finally failed.
pub(crate) last_seq: Arc<MonotonicSeq>,
/// The sequence number of the most recent write that has been fully committed.
/// For reads with dirty=false, the maximum visible sequence number is capped
/// at last_committed_seq.
pub(crate) last_committed_seq: Arc<MonotonicSeq>,
/// The sequence number of the most recent write that has been fully durable
/// flushed to the remote storage.
pub(crate) last_remote_persisted_seq: Arc<MonotonicSeq>,
}criccomini
08/11/2025, 12:56 AMcriccomini
08/11/2025, 12:58 AMflush. This still leaves a bunch of gaps in state exploration, but is an improvement on our current defaults that don't explore any of this. 😛flaneur233
08/11/2025, 1:26 PMmaybe_trigger_flush to ensure that flush is triggered after batch writes, but after double thinking, this mechanism cannot guarantee that flush always happens at batch boundaries.. it's possible that after maybe_trigger_flush, the actual write occurs halfway through the next batch... I think maybe_trigger_flush might need to work together with a lock for appends, or freeze the WAL's kvtable within maybe_trigger_flush..