Repository navigation
Stop successor snapshot dispatch once a discontinued backup is restorable - #14724
tclinkenbeard-oai wants to merge 2 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Avoid a GCC 13 internal compiler error when lowering the braced initializer inside the co_await expression. Move the same one-element vector into join.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Result of foundationdb-pr-macos-m1 on macOS
|
Result of foundationdb-pr-macos on macOS
|
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr-clang-arm on Linux RHEL 9
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr on Linux RHEL 9
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
tclinkenbeard-oai
left a comment
There was a problem hiding this comment.
Generated by Codex.
What problem is this PR trying to solve? (ELI10)
A backup makes a picture of the data and saves a record of later changes. Sometimes it starts the next picture before the record of changes has caught up with the first one. If the user asks the backup to stop in that gap, the first picture can become usable while the backup is still waiting to finish the entire second picture. The PR reports a waiting client taking another 88 simulated seconds after the first picture was usable. Previous continuation · Reported timing
How does this PR solve the problem? (ELI10 and review walkthrough)
Once the first picture is safe to restore, stop scheduling more pieces of its successor. Finish the pieces already handed out, then let the normal completion task close the backup. In the reported run, the successor needed no manifest and the wait after coverage fell to about 18 simulated seconds.
- Discontinue sets a stop flag if the backup lacks a restore point. A previously completed manifest can already have scheduled another snapshot. The ordinary log dispatcher advances the log endpoint after the preceding copy batch has finished. Stop request · Successor scheduling · Log copy dependency · Publishing the log endpoint
- At a range dispatch, require the stop flag, a completed snapshot, an explicit default log type, and a restorable version. The range-file check requires the exclusive log end to pass the first snapshot. In combined snapshot mode the check includes both snapshot types. Guard · Range-file coverage · Combined coverage
- Create or recover the batch’s completion marker before returning early. The finish transaction makes snapshot completion depend on that batch, then releases the dispatcher’s own part. Previously queued ranges keep their outstanding dependencies until they finish. The finalizer waits for both the snapshot and log tasks. Recover the batch · Join and release · Join implementation · Finalizer dependency
What is it trying to do?
Reduce fdbbackup discontinue -w latency when the first manifest becomes restorable after a successor snapshot has started.
Is it correct?
Yes. The check uses durable progress for default logs and excludes missing and partitioned log modes. The finish-time flag defaults to false so an older task without the named parameter follows its existing path. The finalizer still performs its normal cleanup after the joined tasks drain. The new simulation changes the key and requests the stop atomically, restores at that commit version, and checks the value, task buckets and manifest count. Finalizer · Regression setup · Completion and restore assertions
I reviewed the code without running builds, tests or simulations. All 10 currently listed public checks passed on 1d72c920. An earlier run hit the trace-line limit in LowLatencyWithFailures at seed 1407621867. Its configured workloads exercise latency, transactions and machine failure, and the trace gives no causal link to snapshot dispatch. I classify its relevance as inconclusive. Checks at this commit · Simulation attempt
Are there bugs?
I found no correctness bugs in the default-log guard or the completion dependencies. The latency improvement starts at the next dispatch. Its existing schedule and already queued range tasks still determine how long the caller waits. Dispatch schedule
Are there omissions?
The regression disables fault injection and uses one key. It exercises the restore point and the empty-bucket outcome. A dispatcher timing out after queuing ranges, followed by a retry that takes the stop path, is the remaining concurrency case. Test settings · Recovered batch
Are there better ways of doing things?
The existing batch future is the appropriate synchronization mechanism. The dispatch currently reads all shard boundaries before checking the stop flag, so the final dispatch still pays for one metadata scan. Boundary scan
Should this CL be LGTMd?
Yes, LGTM. The public regression checks the actual restored value at the stop transaction’s version. The main residual risk is draining outstanding range tasks when the dispatch itself is retried.
A differential file backup queues the next snapshot as soon as it writes a manifest. If
fdbbackup discontinue -warrives while the first manifest is waiting for log coverage, the log task finishes when that snapshot becomes recoverable. The finalizer still waits for the successor to finish scanning ranges and writing a manifest. This can delay the waiting client for the rest of the snapshot interval.At the next range dispatch, retire the successor if a stop is pending and the backup has a restore point. The check requires an explicitly stored default mutation log type, whose coverage advances after the copy batch is durable. Join the snapshot completion future to the current batch so any ranges already queued by an earlier dispatch attempt drain before the normal finalizer runs.
Regression
The test writes one key, waits for the first manifest, then overwrites the key and requests discontinue in one transaction while log coverage is pending. It waits for completion, checks that the task and future buckets are empty, restores at the transaction’s exact commit version, and reads back the changed value.
With seed
862407215and a 120-second successor interval, the control wrote two manifests and finalized 88.16 simulated seconds after log coverage, past the successor target. The fix produced one manifest and finalized 18.06 simulated seconds after coverage. Both restored the requested value.Validation
862407215,1170476026,578377136,17,52, and302518574on the proposed commit.BackupOldAndNewRestorewith seed1170476026andSharedDefaultBackupCorrectnesswith seed578377136passed with buggify and fault injection enabled.fdbclient_test -f /backup/restore/passed in native and simulated modes.