RocksDB's flush commit order

I know there could be concurrent flushes, however, according to the code/comments, the flushed files are committed in memtable creation order.

Does that mean for a RocksDB instance, a user transaction with a smaller sequence number won’t be persisted after one with a larger seqno?

A memtable with a lower sequence number will indeed always be committed to the manifest before a memtable with a larger sequence number. However, that is also simply the result of WAL order, and unless you do your writes with disableWAL=true, your write will be persisted by the time the write returns, not when the memtable is flushed. The manifest commit order only ensures that SSTs with larger sequence numbers don’t get picked for L0->L1 compaction before SSTs with smaller sequence numbers.

1 Like