You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
backup: fix race condition in starting compaction job
In #145930, scheduled compactions are blocked from running if another
compaction job is running for the schedule. However, it is currently
possible for there to be a race condition which results in a compaction
job being unable to find an incremental backup. Take the following
circumstance:
1. Compaction job A starts.
2. A scheduled backup B completes and begins considering whether a
compaction job should run. It fetches the current chain to its end time
and finds that it should run a compaction.
3. Compaction job A completes.
4. B starts a transaction to create the compaction job. Because A has
completed, it does not block the job from being created.
5. B creates a compaction job C that has a start time that is now
skipped due to A's completion.
6. When C is picked up by the job system, it resolves the backup chain
again, which now no longer has its start time and it fails.
This is resolved by opening a transaction before fetching the backup
chain to check for an already running compaction job.
Fixes: #149867, #147264
Release note: None
0 commit comments