Skip to content

chore(ic-backup): don't hold locks during sleeps between rsync retries and ignore *.tmp files while rsyncing#9736

Merged
kpop-dfinity merged 2 commits intomasterfrom
kpop/chore/backup_locks
Apr 7, 2026
Merged

chore(ic-backup): don't hold locks during sleeps between rsync retries and ignore *.tmp files while rsyncing#9736
kpop-dfinity merged 2 commits intomasterfrom
kpop/chore/backup_locks

Conversation

@kpop-dfinity
Copy link
Copy Markdown
Contributor

@kpop-dfinity kpop-dfinity commented Apr 7, 2026

  1. When a replica backs up an artifact in the backup partition, it first creates a temporary file $dst.tmp, writes to it, and only then renames the file to $dst (see
    ic_sys::fs::write_using_tmp_file(full_path, |writer| writer.write_all(&serialized))
    ).
    This means that if we attempt to rsync the content of the backup partition, we might run into errors because we might initiate a download while a tmp file (very temporarily) exists. To avoid running into file has vanished errors, we propose to ignore all *.tmp files.
  2. Currently, we acquire an exclusive lock for the whole duration of rsync_spool function, including the delays between retries after failures. We propose to hold the lock only for the duration of the rsync command, and drop the lock immediately if the rsync command fails.

This should help with deflaking //rs/tests/consensus/backup:backup_manager_{downgrade|upgrade}_test

@github-actions github-actions bot added the chore label Apr 7, 2026
@kpop-dfinity kpop-dfinity changed the title chore(ic-backup): don't hold locks across during sleeps and ignore *.tmp files while rsyncing chore(ic-backup): don't hold locks during sleeps between rsync retries and ignore *.tmp files while rsyncing Apr 7, 2026
@kpop-dfinity kpop-dfinity marked this pull request as ready for review April 7, 2026 07:29
@kpop-dfinity kpop-dfinity requested a review from a team as a code owner April 7, 2026 07:29
Copy link
Copy Markdown
Contributor

@pierugo-dfinity pierugo-dfinity left a comment

Choose a reason for hiding this comment

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

Nice

@kpop-dfinity kpop-dfinity enabled auto-merge April 7, 2026 08:52
@kpop-dfinity kpop-dfinity added this pull request to the merge queue Apr 7, 2026
Merged via the queue into master with commit 44fc157 Apr 7, 2026
37 checks passed
@kpop-dfinity kpop-dfinity deleted the kpop/chore/backup_locks branch April 7, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants