feat(storage): reclaim disk safely during live queries#87
Draft
mo4islona wants to merge 1 commit into
Draft
Conversation
fa14df9 to
6862cfd
Compare
Persist purge sequences and guard whole-file reclaim with RocksDB's oldest live snapshot. Add periodic runtime reclaim and continuous-query churn coverage. Co-Authored-By: Codex <codex@openai.com>
6862cfd to
18f1e1c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Safety model
Deletion records now move through DeleteRequested -> PurgedUnstamped -> Purged(sequence). Empty legacy values still decode as DeleteRequested, so no migration is needed. The unstamped state makes a crash between the tombstone batch and sequence stamp recoverable and fail-closed.
Runtime reclaim takes one consistent metadata snapshot, computes a watermark from live tables, dirty builds, and deletion records still visible to the oldest snapshot, then calls DeleteFilesInRange. Once a purge sequence is older than every live snapshot, that fact is monotonic: future snapshots cannot become older.
This keeps the snapshot-safe point-delete mechanism from #84 and does not introduce DeleteRange or a compaction filter.
Verification
The CT7 soak ran periodic reclaim every 2 seconds while two clients continuously queried the moving retention window.