Repository navigation
refactor: give encoded ZSet pages a dedicated loader - #360
thweetkomputer merged 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe change separates regular ordered-group snapshots from encoded sorted-set snapshots. Sorted-set point-write reads and mutation planning now use the encoded snapshot loader. The bycorf subproject reference also advances to a new commit. ChangesGrouped Sorted-Set Snapshot Loading
bycorf Subproject Reference
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~15 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to
|
Context
LoadOrderedGroupSnapshotaccepted a ZSet-specific boolean that changed its return representation: callers could receive either owned member strings or an encoded page with emptyentries_. That choice was hidden in a loader shared by List, String, Stream, ZSet and maintenance paths.Behavior before and after
The common loader now always returns materialized owned entries. Single-member ZSet writes explicitly call
LoadEncodedSortedSetGroupSnapshotto obtain a validated encoded page. Existing command behavior and page formats are preserved.Implementation
LoadOrderedGroupSnapshot.LoadOrderedGroup<Result, Decode>for physical I/O, version checks, GC retries and lease handling. The new loader always performs full member validation and verifies score bounds.587a9e776f9f64729456d6772596d53597f4a983to08fa44dad5c695f6b2bfedc47e37708c1eeaffae, which migrates software regression tests to GoogleTest (Convert software regressions to individual GoogleTest cases bycorf#18).Design decisions and alternatives
Separate function names expose the ownership representation without duplicating the shared I/O lifecycle. Encoded snapshots retain the existing worker-local ownership contract.
Documentation and comments
The new API comment explicitly states that
encoded_sorted_set_is populated,entries_is empty, and snapshots remain on the key owner worker. The existing architectural model remains accurate.Test plan
git diff --check: passed.9a3d375cwith Bycorf08fa44da.Risk assessment
The main risk is selecting the wrong representation at a ZSet call site. Both point-write sites now name the encoded loader explicitly; other callers retain the existing materialized loader. Regression coverage exercises point edits, fallback, ownership, TTL and recovery.
Rollback plan
Revert this PR; no data conversion is needed.
Reviewer guide
Review the two loader contracts in
impl.h, their shared-I/O adapters inordered_io.cpp, and the two selections inzset.cpp. The Bycorf gitlink is a separate dependency refresh.Follow-up work
None required for this refactor.