Skip to content

fix(trie): fail-closed on malformed tombstone (CodeRabbit follow-up to #798)#799

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/trie-gc-fail-closed
Jun 6, 2026
Merged

fix(trie): fail-closed on malformed tombstone (CodeRabbit follow-up to #798)#799
github-actions[bot] merged 1 commit into
mainfrom
fix/trie-gc-fail-closed

Conversation

@satyakwok
Copy link
Copy Markdown
Member

Addresses the two CodeRabbit findings on #798's generational GC.

  • Major — non-8-byte tombstone payload → tv=0 → instantly reapable (could delete live trie data). Now fail closed: skip reaping malformed tombstones + warn, never default to 0.
  • Critical (doc) — narrow content-addressed resurrection window remains inside the reap's own scan+delete. Documented the caller contract (tree.rs re-augments live to the latest root immediately before each gc pass → window collapses from the old multi-minute walk to ms) and that full elimination needs writer-coupling (single RW txn) — the deferred complete fix. Strictly narrows the race; verify_integrity is the backstop.

Regression test: malformed tombstone must not authorise deletion. cargo test -p sentrix-trie: 83 passed.

…residual

Follow-up to #798 addressing two CodeRabbit findings on the generational GC:

- Major: a non-8-byte tombstone payload mapped to tv=0, making a corrupt
  entry immediately reapable (could delete live trie data). Now fail closed —
  skip reaping malformed tombstones (keep the entry) and warn, instead of
  defaulting to 0.
- Critical (documentation): the reap still has a narrow content-addressed
  resurrection window inside its own scan+delete. Documented the caller
  contract (tree.rs re-augments `live` to the latest committed root
  immediately before each gc pass, collapsing the window from the old
  multi-minute walk to this method's ms-scale scan+delete) and that the
  complete elimination needs writer-coupling (walk+delete in one RW txn) —
  the tracked fix this PR-series deliberately defers to avoid a chain-blocking
  write lock. This series strictly narrows the race; verify_integrity remains
  the backstop.

Regression test: a malformed tombstone must not authorise deletion
(data survives). sentrix-trie: 83 passed.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 6, 2026

Warning

Review limit reached

@satyakwok, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 4 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e1c6bf70-2eb1-4ba8-95b0-b97cfc3d5428

📥 Commits

Reviewing files that changed from the base of the PR and between d93bbfe and bb2abfe.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • crates/sentrix-trie/src/storage.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/trie-gc-fail-closed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot enabled auto-merge (squash) June 6, 2026 08:29
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 96.87500% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/sentrix-trie/src/storage.rs 96.87% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot merged commit 1550e9c into main Jun 6, 2026
18 checks passed
@satyakwok satyakwok deleted the fix/trie-gc-fail-closed branch June 6, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant