[Tsavorite] Fix post-checkpoint object cleanup - #2079
Open
Ted Hart (TedHartMS) wants to merge 5 commits into
Open
[Tsavorite] Fix post-checkpoint object cleanup#2079Ted Hart (TedHartMS) wants to merge 5 commits into
Ted Hart (TedHartMS) wants to merge 5 commits into
Conversation
Scan object values without remapping overflow keys and isolate cleanup failures from checkpoint success. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0017de04-0a5f-48e4-a1ce-56620534a5d3
Ted Hart (TedHartMS)
requested review from
Badrish Chandramouli (badrishc)
and
a balanced review from Copilot
August 19, 2026 10:26
Contributor
There was a problem hiding this comment.
Pull request overview
Reworks post-checkpoint object cleanup to avoid overflow-key remapping races while preserving successful checkpoint results.
Changes:
- Adds an epoch-protected, value-only cleanup scan.
- Makes cleanup failures non-fatal and logged.
- Adds concurrency, overflow-key, and serialization-state tests.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
test/standalone/Garnet.test/RespAdminCommandsTests.cs |
Tests checkpoint completion and failure isolation. |
libs/storage/Tsavorite/cs/test/test.recovery/ObjectLogScanTests.cs |
Tests cleanup boundaries, eviction, and serialization state. |
libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs |
Adds guarded slot lookup. |
libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/LogAccessor.cs |
Exposes cached-object cleanup. |
libs/storage/Tsavorite/cs/src/core/Allocator/ObjectIdMap.cs |
Adds type-safe heap-object lookup. |
libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs |
Implements the value-only cleanup scan. |
libs/storage/Tsavorite/cs/src/core/Allocator/IHeapObject.cs |
Clarifies cleanup semantics. |
libs/storage/Tsavorite/cs/src/core/Allocator/HeapObjectBase.cs |
Avoids resetting unrelated serialization. |
libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs |
Defines the allocator cleanup hook. |
libs/server/Databases/DatabaseManagerBase.cs |
Uses isolated cleanup after checkpoints. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Description of Change
Replace the generic post-checkpoint log scan with an allocation-free value-only scan that does not remap overflow keys. Heap-object references are captured under epoch protection and cleared after releasing it.
Cleanup failures are logged without changing the result of a completed checkpoint.
Tests
Added coverage for overflow keys, concurrent eviction, absent cached data, cleanup failure isolation, and repeated incremental checkpoints on .NET 8 and 10.
Issues Fixed
Fixes #2072