You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(version): persist the retention boundary across reopen
The boundary a GC compaction or `clear` established lived only in the
in-memory version history: `SuperVersions::new` seeded the recovered
version at seqno 0, so after a restart every historical snapshot was
served from the surviving version, silently answering with data the
snapshot never saw (the exact outcome `SnapshotBelowRetention` exists to
refuse).
- `Version::retention_floor`: the highest snapshot seqno the version can
no longer serve, monotone across versions; persisted as the manifest
`retention_floor` section and an appended edit-log field (both
optional, so older manifests recover as floor 0)
- `RetentionEffect` names what an install does to older snapshots and is
passed to `upgrade_version`: a GC compaction (`GcBelow(w)`) raises the
floor to `w - 1`, a `clear` / table drop (`DropsData`) to its own
install seqno, additive installs (`Keep`) leave it alone; the floor
rides in the same version edit as the data loss it records
- a reopened history is seeded at the floor, version seqnos are clamped
non-decreasing (a counter reset below the floor cannot slip a version
under it) and `get_version_for_snapshot` checks the front explicitly
- `Config::repair_retention_floor` (default 0): a rebuilt manifest cannot
derive the floor (a GC compaction zeroes the settled rows' seqnos) and
must not guess it (the external-WAL reconciliation reads intermediate
snapshots back), so the deployment that ran the compactions supplies it
- `BlobTree::multi_get` validates the snapshot before the empty-batch
return, matching `Tree::multi_get`
- the retention fixture pins `first + 1 < oldest_retained_seqno()` so the
strict-below probes stay strict
- docs: INVARIANTS (durable boundary), manifest-recovery (retention
floor), external-wal (repair floor)
Regression tests cover reopen after GC compaction / clear / drop_range /
FIFO eviction / leveled merge, additive installs, manifest rotation, a
reopen chain, a reset counter, checkpoints and repair, on both tree
types; edit / diff / recovery / history unit tests cover the codec and
the boundary check.
Part of #616
0 commit comments