Conversation
… to smaller memory in SeSaveRecoverMultipleKeysTest("25k","18k")
There was a problem hiding this comment.
Pull request overview
This PR fixes an intermittent snapshot-recovery data-loss regression under tight memory budgets by ensuring snapshot pages are made durable (flushed) before recovery-time eviction can free them. It also adds a regression test covering the failure mode and tightens a couple of recovery/resource-management code paths.
Changes:
- Update Tsavorite snapshot recovery to flush every snapshot page when a
LogSizeTrackeris attached (so recovery-time eviction cannot drop unflushed pages). - Make snapshot object-log recovery device initialization/disposal null-safe when the store has no object log.
- Add a regression test that recovers a SpanByte snapshot into a smaller budget (with optional concurrent resizer) and verifies all records read back correctly; add a clarifying comment in
ContinuePendingRead.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libs/storage/Tsavorite/cs/src/core/Index/Recovery/Recovery.cs | Flush all snapshot pages under LogSizeTracker; null-safe object-log recovery device setup/teardown. |
| libs/storage/Tsavorite/cs/test/test.recovery/SpanByteRecoverySnapshotEvictionTests.cs | New regression test for snapshot recovery under budget-driven eviction (SpanByte/inline store). |
| libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ContinuePending.cs | Comment clarifying why status is already SUCCESS at the copy-to-tail/readcache decision point. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…flush pages from the snapshot region unless the recovery memory budget is so much smaller that it has to; fix the pass2 object loading sequence when snapshot is present.
|
Possibly-related data point: I've seen the same works-before-save, one-record-missing-after-
Both fail identically: after I haven't been able to bisect or reproduce this locally (no native Not asking you to scope this PR to cover it — just flagging in case it's useful corroborating evidence (or in case you want to add a VectorSet-specific case to |
This pull request addresses a regression in snapshot recovery under memory budget constraints, ensuring that all pages are properly flushed and no data is lost during recovery. It also improves resource management and clarifies code paths for different store configurations. The most important changes are:
Bug Fixes and Recovery Logic Improvements:
RecoverSnapshotPagesinRecovery.csto always flush every page when aLogSizeTrackeris attached, regardless of whether the store is an object allocator or not. This prevents data loss when recovering into a smaller memory budget, fixing a scenario where pages could be evicted before being flushed, resulting in lost records.RecoverSnapshotPagesby removing unused parameters related to page ranges, reflecting the new logic that flushes all pages under a memory budget. [1] [2]Resource Management:
objectLogRecoveryDevicemay be null, preventing potential null reference exceptions.objectLogRecoveryDeviceto only occur when the store has an object log, and made its initialization call null-safe.Testing and Documentation:
SpanByteRecoverySnapshotEvictionTeststo verify that all records are correctly recovered when restoring from a snapshot under a tighter memory budget, and that no records are lost due to premature eviction.ContinuePending.csto document status handling during read operations.