Skip to content

fix: remove orphaned snapshot exports at startup - #158

Merged
bmuddha merged 1 commit into
devfrom
fix/orphaned-snapshot-exports
Sep 24, 2026
Merged

bmuddha merged 1 commit into
devfrom
fix/orphaned-snapshot-exports

Conversation

@bmuddha

@bmuddha bmuddha commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

What changed

An interrupted seal can leave a temporary AccountsDB export directory behind. Keeper now removes orphaned exports at startup, before archival begins, so a later seal can reuse the path.

Closes #157

Related: magicblock-labs/magicblock-validator#1731

Impact

Startup treats every snapshot-* entry under the AccountsDB root as an owned temporary export. Retained snapshots in the ledger are unaffected.

@bmuddha bmuddha self-assigned this Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: magicblock-labs/magicblock-engine/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9f9773ac-a604-4afa-a828-9764f06e3bfb

📥 Commits

Reviewing files that changed from the base of the PR and between e1fb74f and 78141c2.

📒 Files selected for processing (3)
  • accountsdb/README.md
  • accountsdb/src/snapshot.rs
  • keeper/src/builder.rs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

AccountsDB now removes entries with the snapshot- prefix from its root directory. KeeperBuilder::build calls this cleanup before prepopulating accounts and caches, and propagates cleanup errors. The README describes snapshot export directories as temporary and states that retained snapshots live in the ledger.

Fixed issue severity: <fixed_issue_severity>Medium</fixed_issue_severity>

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 78141

The startup cleanup appears ready to merge after normal checks; no supported path was found that would prevent it from removing orphaned exports.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains that Keeper removes orphaned temporary AccountsDB snapshot exports at startup and preserves retained ledger snapshots.
Title check ✅ Passed The title clearly and concisely states the main change: removing orphaned snapshot exports at startup.
Linked Issues check ✅ Passed The changes satisfy issue #157. AccountsDB::cleanup_snapshots removes root entries whose names start with snapshot-. KeeperBuilder::build calls this method after opening AccountsDB and before pr…
Out of Scope Changes check ✅ Passed The changes stay within issue #157 and PR #158. The README documents the temporary export lifecycle. The new AccountsDB cleanup method implements startup removal. The Keeper builder call places cleanu…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 …
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@bmuddha
bmuddha marked this pull request as ready for review September 24, 2026 03:21
@bmuddha
bmuddha merged commit b1d1f94 into dev Sep 24, 2026
9 checks passed
@bmuddha
bmuddha deleted the fix/orphaned-snapshot-exports branch September 24, 2026 03:28
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.

Orphaned snapshot exports prevent restart after an interrupted seal

2 participants