Skip to content

fix: lock backup path during backup mutations#3244

Open
giwaov wants to merge 1 commit into
chainwayxyz:nightlyfrom
giwaov:fix-3039-backup-lockfile
Open

fix: lock backup path during backup mutations#3244
giwaov wants to merge 1 commit into
chainwayxyz:nightlyfrom
giwaov:fix-3039-backup-lockfile

Conversation

@giwaov

@giwaov giwaov commented Apr 30, 2026

Copy link
Copy Markdown

Summary

  • closes Rocksdb backup creation lockfile #3039
  • adds a per-backup-directory .backup.lock file acquired with atomic create_new
  • holds the lock during backup creation and purge operations so separate processes cannot mutate the same backup path concurrently

Testing

  • rustfmt +stable crates/common/src/backup/manager.rs
  • git diff --check
  • cargo check -p citrea-common (blocked: rustup could not download pinned Rust 1.88 due DNS failure)
  • cargo +stable check -p citrea-common (blocked: sparse checkout is missing unrelated workspace member crates/primitives)

@giwaov giwaov requested a review from a team as a code owner April 30, 2026 18:25
@auto-assign auto-assign Bot requested a review from jfldde April 30, 2026 18:25
.or(self.base_path.as_ref())
.context("Missing path and no backup_path found in config.")?;

let _backup_path_lock = BackupPathLock::acquire(backup_path)?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this immediately dropped?

@jfldde

jfldde commented May 5, 2026

Copy link
Copy Markdown
Contributor

holds the lock during backup creation and purge operations so separate processes cannot mutate the same backup path concurrently

This is already handled by rocksdb LOCKFILE.
Point of this issue is for observability of an on-going backup creation process

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.

Rocksdb backup creation lockfile

3 participants