fix!: skip non-Merk descendants during recursive discovery - #949
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR adds a versioned subtree-discovery setting. GROVE_V4+ includes non-Merk descendants in cleanup without traversing their records as Merk nodes. GROVE_V1–V3 retain legacy behavior. Tests cover storage families, deletion routes, cleanup, and version errors. ChangesNon-Merk subtree discovery
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to V4 cleanup can now remove populated non-Merk descendant namespaces without decoding their payloads as Merk nodes, while prior versions retain historical behavior. The covered cleanup and compatibility paths show no remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 58.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 11 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #949 +/- ##
========================================
Coverage 92.99% 93.00%
========================================
Files 327 330 +3
Lines 103297 103349 +52
========================================
+ Hits 96065 96117 +52
Misses 7232 7232
🚀 New features to boost your workflow:
|
Issue being fixed or feature implemented
Closes #890. Recursive discovery tries to decode populated non-Merk descendants as Merk nodes, preventing discovery and deletion of an otherwise healthy ancestor tree. Reproduced independently for MMR, bulk append, dense, commitment, and private document storage, plus a wrapped MMR.
What was done?
Use separate
find_subtrees_v0andfind_subtrees_v1functions in version-specific modules, selected by a dispatcher. V0 preserves the original implementation. V1 classifies descendants using their already-decoded elements, keeping every tree namespace in the cleanup result but only enqueueing Merk-backed descendants for traversal. The shared cleanup still clears non-Merk payloads and all indexed-axis namespaces.Enable the fix through
operations.non_merk_tree.subtree_discoveryon Grove V4. V1–V3 retain historical traversal, costs, and failures. No additional storage reads are needed.How Has This Been Tested?
NonCountedwrapper, direct/full-batch/partial-batch deletion, transaction visibility, persisted namespace cleanup, all three indexed axes, retained sibling data, and legacy/unknown version behavior.cargo test -p grovedb -p grovedb-version --lib --offline: 3,506 passed, eight existing ignored tests. Includes existing versioned deletion-cost regressions.cargo fmt -p grovedb -p grovedb-version --checkandgit diff --checkpassed.cargo clippy -p grovedb -p grovedb-version --lib --tests --no-deps --offline -- -D warningspassed.Breaking Changes
Adds
subtree_discoveryto the publicGroveDBOperationsNonMerkTreeVersionsstruct. Custom struct literals must initialize the new version slot. Grove V1–V3 behavior remains unchanged.Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Bug Fixes