Skip to content

fix: clean up persisted accounts after owned mode changes - #167

Merged
bmuddha merged 1 commit into
devfrom
fix/persisted-mode-cleanup
Oct 1, 2026
Merged

bmuddha merged 1 commit into
devfrom
fix/persisted-mode-cleanup

Conversation

@bmuddha

@bmuddha bmuddha commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

What changed

Resolving a Transient account to ReadOnly now removes its persisted copy even when data growth promotes the borrowed image to owned storage. Owned accounts with a dirty mode marker reach the existing persisted cleanup path, preventing duplicate program-scan entries and stale state resurfacing after volatile eviction.

Closes #166

Impact

Ordinary ReadOnly refreshes still avoid persisted writes. This prevents new stale copies; it does not repair copies left behind before the fix.

@bmuddha bmuddha added the bug Something isn't working label Oct 1, 2026
@bmuddha bmuddha self-assigned this Oct 1, 2026
@coderabbitai

coderabbitai Bot commented Oct 1, 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: 7c4f63ac-feaf-456c-91af-2cfc0fb4b6a4

📥 Commits

Reviewing files that changed from the base of the PR and between b927be8 and 8e4ab5f.

📒 Files selected for processing (1)
  • accountsdb/src/lib.rs

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


📝 Walkthrough

Walkthrough

The persisted check now accepts owned accounts when their mode is authoritative or their mode marker is dirty. This lets mode-transition entries reach persisted cleanup. Borrowed-account handling is unchanged.

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 8e4ab

The change makes resolving a Transient account to ReadOnly remove its persisted copy even when the image is promoted to owned storage. No concrete merge-blocking risk was identified in the reviewed change.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: cleaning up persisted accounts after owned mode changes.
Description check ✅ Passed The description directly explains the code change, its impact, linked issue, and known limitations.
Linked Issues check ✅ Passed Issue #166 requires persisted cleanup when a Transient account resolves to a larger ReadOnly image and resizing changes the entry to Owned. accountsdb/src/lib.rs now routes an Owned entry to persist…
Out of Scope Changes check ✅ Passed The available change is limited to the persisted backend-selection predicate and its DirtyMarkers import in accountsdb/src/lib.rs. The change directly supports Issue #166 persisted cleanup. No u…
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 1 functions across 1 files.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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 October 1, 2026 05:46
@bmuddha
bmuddha merged commit 823543e into dev Oct 1, 2026
13 checks passed
@bmuddha
bmuddha deleted the fix/persisted-mode-cleanup branch October 1, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transient account resolved to a larger read only image keeps a stale persisted copy

2 participants