Enqueue deleted directory objects for reclamation - #26
Merged
Conversation
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
KvDirectorybenchmark for buffered writes, flushes, chunk publication, deletion, and distinct-file concurrencyDesign
Each binding already carries the highest chunk and tail revision that may exist for its immutable object. Deletion now retires the matching writer, waits for any admitted storage operation to reach a definitive result, rereads the binding when a writer was active, and atomically writes:
The queue uses 64 fixed shards and only the existing point-read and atomic-batch
KvStoreoperations. Object IDs are durably reserved in strides of 1,024, removing a counter read and mutation from almost everyopen_write(). The common closed-writer delete is four point reads and one four-mutation batch; an active writer adds one binding reread.The writer fence uses sequentially consistent retirement and in-flight counters. Normal claim/release stays mutex-free; only the final release after retirement enters the condition-variable notification path. A live writer retains the shared directory state so a reconstructed wrapper for the same canonical store identity cannot lose its fence.
The canonical
KvStoreIdentitycontract is load-bearing: every wrapper for one live store incarnation and derived column family must converge on oneDirectoryState. This library cannot replace that Harper lifecycle guarantee with compare-and-set becauseKvStoreintentionally exposes no CAS primitive. Harper production use remains disabled until the derived-index integration proves canonical identity and exclusive generation ownership across its worker topology.The release-mode
kv_directoryharness isolates directory coordination with the deterministic in-memory Phase 0 store. It emits versioned JSON with percentiles across per-sample mean latency, throughput, Git revision and dirty state, build profile, enabled features, and host metadata. Workloads cover caller-visible buffered writes without crossing a chunk boundary, empty and dirty flushes, 256 KiB chunk publication, closed- and active-writer deletion, and distinct-file concurrency at one, two, four, and eight threads. The in-memory store serializes access, so concurrency results detect coordination regressions rather than predict RocksDB scaling. CI runs a plural-operation correctness smoke without timing thresholds; comparative performance runs use alternating revisions on one fixed quiet host.Verification
npm run checknpm run benchmark:kv-directory -- --smoke --revision ce26565ce26565; output validated as JSONPart of #11
Comment generated by kAIle (GPT-5)
Review-Coverage: authored=unknown; ran=none; rounds=1 @ ce26565
Human-Review-Need: 4 @ ce26565