Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
tolerance is now an exact equality).

### Changed
- **One typed-accessor skeleton in `Database` (W5).** The ~20-method
accessor matrix (`get_X` / `get_or_create_X` / `get_X_ref_if_alive` per
container type) copy-pasted the same skeleton — expiry check → cold
promote/read-through → compact-encoding upgrade → variant projection —
once per type. The skeleton now exists once per access shape
(`get_ref_if_alive::<K>` / `get_or_create::<K>` / `get_promoted::<K>`);
everything genuinely per-type lives in the new `storage::db_kind` module
as `ValueKind`/`OwnedKind` marker impls (static dispatch — generated code
identical to the hand-written originals). The public per-type methods
remain as thin delegators, so command-layer call sites are unchanged.
The four caller-less `get_X_if_alive` variants (compact encodings
returned `None`; superseded by the `_ref_if_alive` family) are deleted.
Pure refactor — behavior pinned by two new tests (hot-WRONGTYPE through
the ref accessors; `HashWithTtl` → `HashRef::WithTtl` wiring incl.
caller-`now_ms` propagation) plus the existing cold-visibility pins.

- **One eviction entry point (W4).** The 13-name `try_evict_if_needed*`
family (every combination of spill-sink / explicit-total / elastic-budget /
plain-drop-reporting encoded as a function-name suffix) is replaced by a
Expand Down
2 changes: 1 addition & 1 deletion src/command/geo/geo_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ fn geosearch_core(
// Read-only twins for the shared-lock (dispatch_read) path
// ---------------------------------------------------------------------------
//
// GEO data is stored as a sorted set: all twins use `get_sorted_set_if_alive`.
// GEO data is stored as a sorted set: all twins use `get_sorted_set_ref_if_alive`.

/// GEOPOS key member [member …] — read-only twin.
pub fn geopos_readonly(db: &crate::storage::db::Database, args: &[Frame], now_ms: u64) -> Frame {
Expand Down
2 changes: 1 addition & 1 deletion src/command/sorted_set/sorted_set_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ fn collect_source_sets(
Ok(source_data)
}

/// Read-only twin: collect source sets using `get_sorted_set_if_alive`.
/// Read-only twin: collect source sets using `get_sorted_set_ref_if_alive`.
///
/// Compact (listpack) encodings return an empty map — callers see an absent
/// set, which is correct because compact sets are upgraded to BPTree on first
Expand Down
Loading
Loading