feat(mem_wal): tombstone-preserving point lookup#7482
Merged
jackye1995 merged 1 commit intoJun 26, 2026
Conversation
Add `LsmPointLookupPlanner::lookup_keep_tombstone` and `lookup_many_keep_tombstone`: point-lookup variants that carry the `_tombstone` marker through instead of filtering deleted keys out. The existing `lookup` collapses "deleted in the fresh tier" and "absent" into a single `None`; these variants distinguish them by returning the deleted row with `_tombstone = true` (absent keys still return `None`). Refactors `plan_lookup` to share `plan_lookup_coalesced`, leaving the hot read path unchanged. The sophon WAL partial-column-update merge uses this to treat a fresh-deleted PK as absent rather than resurrecting stale base columns. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
BubbleCal
pushed a commit
that referenced
this pull request
Jun 30, 2026
## What Adds `LsmPointLookupPlanner::lookup_keep_tombstone` and `lookup_many_keep_tombstone` — point-lookup variants that carry the `_tombstone` marker through instead of filtering deleted keys out. ## Why The existing `lookup` / `lookup_many` collapse two distinct states — **deleted in the fresh tier** and **never written** — into a single `None`. That's correct for a normal reader, but a caller doing a read-on-write merge needs to tell them apart: a fresh-deleted PK must be treated as *absent* (so a later partial update resurrects it from carried columns + NULLs), while a never-written PK falls back to the base row. These variants return the deleted row with `_tombstone = true`; absent keys still return `None`. Implemented by refactoring `plan_lookup` to share a `plan_lookup_coalesced` helper and skipping the post-coalesce tombstone filter, so the hot read path is unchanged. ## Tests - `test_lookup_keep_tombstone_returns_deleted_row_with_marker` - `test_lookup_many_keep_tombstone_includes_tombstoned_keys` ## Context Prerequisite for a downstream WAL partial-column-update resurrection fix: a partial update arriving after a delete must resurrect carried columns + NULL untouched, never stale pre-delete base data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
BubbleCal
pushed a commit
that referenced
this pull request
Jun 30, 2026
Backport of the following PRs: - #7362 - #7417 - #7482 - #7483 - #7489 This PR backports the changes from the original PRs to the release/v8.0 branch. --------- Co-authored-by: Dan Rammer <[email protected]> Co-authored-by: Lance Release Bot <[email protected]> Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
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.
What
Adds
LsmPointLookupPlanner::lookup_keep_tombstoneandlookup_many_keep_tombstone— point-lookup variants that carry the_tombstonemarker through instead of filtering deleted keys out.Why
The existing
lookup/lookup_manycollapse two distinct states — deleted in the fresh tier and never written — into a singleNone. That's correct for a normal reader, but a caller doing a read-on-write merge needs to tell them apart: a fresh-deleted PK must be treated as absent (so a later partial update resurrects it from carried columns + NULLs), while a never-written PK falls back to the base row.These variants return the deleted row with
_tombstone = true; absent keys still returnNone. Implemented by refactoringplan_lookupto share aplan_lookup_coalescedhelper and skipping the post-coalesce tombstone filter, so the hot read path is unchanged.Tests
test_lookup_keep_tombstone_returns_deleted_row_with_markertest_lookup_many_keep_tombstone_includes_tombstoned_keysContext
Prerequisite for a downstream WAL partial-column-update resurrection fix: a partial update arriving after a delete must resurrect carried columns + NULL untouched, never stale pre-delete base data.
🤖 Generated with Claude Code