[KV] Support MVCC point and prefix lookups at a bucket log offset
Search before asking
- [x] I searched the existing issues for MVCC and versioned lookups at a bucket log offset.
Motivation
A stream processor can checkpoint its position in a Fluss primary-key bucket and resume changelog consumption there. If a row changes after that checkpoint, replaying the same input with an ordinary lookup can return a different value. A prefix lookup can also return a different set of rows.
Draft PR #5277 — RocksDB proof of concept · Draft FIP — Read Primary Key Tables at a Bucket Log Offset
Solution
Allow a caller to pass a bucket identity and an exclusive log offset to a point or prefix lookup on an MVCC-enabled primary-key table. A read at position P observes changes with offsets strictly below P. A prefix lookup returns all matching rows at that same position.
The draft PR exercises the storage part of the proposal. It uses prepared Fluss KV flushes and RocksDB user-defined timestamps to preserve multiple changes to a key within one flush. It checks point and prefix results across updates and deletes, including at the earliest retained position after compaction and local database reopen.
Anything else?
The FIP also specifies committed visibility, client error handling, time-based retention and recovery after a leader change. Those behaviors need end-to-end validation. The prototype uses the RocksDB JNI timestamp bindings.
Willingness to contribute
- [x] I'm willing to submit a PR!