Skip to content

Backup: fail a backup whose bulkdump did not complete - #13936

Merged
saintstack merged 1 commit into
apple:mainfrom
saintstack:fix-bulkdump-timeout-fails-backup
Aug 24, 2026
Merged

saintstack merged 1 commit into
apple:mainfrom
saintstack:fix-bulkdump-timeout-fails-backup

Conversation

@saintstack

@saintstack saintstack commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

monitorBulkDumpJobCompletion returning false was treated as a warning:

bool completed = co_await monitorBulkDumpJobCompletion(cx, jobId, CLIENT_KNOBS->BULKDUMP_JOB_TIMEOUT, 5.0);
if (!completed) {
    TraceEvent(SevWarn, "BulkDumpTaskTimeout")...   // SevWarn
    Params.timeoutOccurred().set(task, true);       // recorded, never read
}
...
if (completed) {                                    // everything below is gated
    verifyBulkDumpDatasetCompleteness(...)           // fails the backup if data is missing
    writeKeyspaceSnapshotFile(...)                   // writes the bulkDumpJobId a restore needs
}

A timed-out dump therefore skipped the completeness check and the keyspace snapshot, and the backup still
reported success. The artifact has no bulkDumpJobId, so no bulkload restore can use it. First loud symptom
is SevError BulkLoadRestoreNoBulkDumpJobId at restore time, hours later, pointing at the wrong subsystem.

Fix

Fail the backup at the point of detection.

This closes an asymmetry rather than adding a rule: verifyBulkDumpDatasetCompleteness already fails the
backup for the same class of problem — data promised, not present — but it sits inside the completed
branch, so timeout was the one route that skipped every check and still succeeded.

  • No cleanup at the throw site: the enclosing handler logs BulkDumpTaskError and restores bulkDump mode
    before rethrowing.
  • BulkDumpTaskTimeout keeps its name and gains a Reason; only severity changes. The condition is still
    exactly a timeout, so renaming would break trace searches for no gain.
  • The now-redundant if (completed) guard is left in place to keep the change one readable block rather
    than a fifty-line reindentation.

Behaviour change

Backups that previously succeeded while silently degrading now fail. The three BackupS3Blob tests set
their own budgets — bulkdump_job_timeout = 1200 plain, 5400 MultiRange and WithChaos — so any test whose
budget is too small for its shard count will now fail loudly instead of leaving an unrestorable backup.
Those budgets are worth re-checking as this lands, and Joshua's wider seed spread is where an undersized one
would show up.

Testing

All three restore suites, two seeds each, all pass with BulkDumpTaskWroteSnapshot present and no timeout —
the new path stays dormant on healthy runs:

PASS plain      seeds 101, 202
PASS MultiRange seeds 101, 202
PASS WithChaos  seeds 101, 202

The failure path was observed before this change under min_shard_bytes 1000x below default (one manifest
per shard, thousands of dump tasks): the dump exceeded the plain variant's 1200s budget, the backup reported
success with no snapshot, and the following restore aborted with BulkLoadRestoreNoBulkDumpJobId.

Rebased onto current main now that #13924 has merged; this PR contains one commit.

The bulkdump branch of the backup task treated a dump that never finished as a warning. It set
timeoutOccurred, skipped the keyspace snapshot, and let the backup report success -- producing a backup
with no bulkDumpJobId, which no bulkload restore can use. Nothing surfaced until a restore aborted with
BulkLoadRestoreNoBulkDumpJobId, hours later and pointing at the wrong end of the system.

A backup asked to produce bulkdump data and unable to do so has not succeeded, so fail it where that is
known.

This closes an asymmetry rather than adding a rule. verifyBulkDumpDatasetCompleteness already fails the
backup for the same class of problem -- data promised but not present -- but it sits inside the `completed`
branch, so a timeout was the one route that skipped every check and still reported success. The enclosing
handler already logs BulkDumpTaskError and restores bulkDump mode before rethrowing, so the failure needs
no special cleanup here.

BulkDumpTaskTimeout keeps its name and gains a Reason; only its severity changes. The condition it reports
is still exactly a timeout -- monitorBulkDumpJobCompletion returns false only on that branch -- so renaming
it would break trace searches and dashboards for no gain.

The `if (completed)` guard below is now redundant. It is left in place so the change reads as one block
rather than a fifty-line reindentation.

Behaviour change worth noting for reviewers: a backup that previously "succeeded" while silently degrading
will now fail. The three BackupS3Blob tests set their own budgets -- bulkdump_job_timeout = 1200 for the
plain variant, 5400 for MultiRange and WithChaos -- so a test whose budget is too small for its shard count
will now fail loudly instead of leaving an unrestorable backup behind. That is the intent, but those budgets
should be re-checked when this lands.
@saintstack
saintstack force-pushed the fix-bulkdump-timeout-fails-backup branch from 46f739d to 3ebee84 Compare August 22, 2026 21:13
@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

@foundationdb-ci

This comment has been minimized.

// never ran on this route -- a timeout was the one way to skip every check and still report
// success. Mode restoration needs no handling here; the catch below already does it on the
// error path.
if (!completed) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am just curios to know, if it is not completed, is there no retry mechanism?

@saintstack saintstack closed this Aug 24, 2026
@saintstack saintstack reopened this Aug 24, 2026
@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-ide on Linux RHEL 9

  • Commit ID: 3ebee84
  • Duration 0:22:00
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos-m1 on macOS 14.x

  • Commit ID: 3ebee84
  • Duration 0:34:30
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang-arm on Linux RHEL 9

  • Commit ID: 3ebee84
  • Duration 0:46:49
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-clang on Linux RHEL 9

  • Commit ID: 3ebee84
  • Duration 0:48:36
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-macos on macOS 14.x

  • Commit ID: 3ebee84
  • Duration 0:48:44
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr on Linux RHEL 9

  • Commit ID: 3ebee84
  • Duration 1:01:46
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

Result of foundationdb-pr-cluster-tests on Linux RHEL 9

  • Commit ID: 3ebee84
  • Duration 1:28:24
  • Result: ✅ SUCCEEDED
  • Error: N/A
  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)
  • Cluster Test Logs zip file of the test logs (available for 30 days)

@saintstack
saintstack merged commit f56ec42 into apple:main Aug 24, 2026
6 checks passed
saintstack added a commit that referenced this pull request Aug 26, 2026
…13945)

BULKDUMP_JOB_TIMEOUT and BULKLOAD_JOB_TIMEOUT are spent against total elapsed
time, so both monitors abort jobs that are advancing normally. Their own comments
concede the premise is wrong -- "24 hours - large DBs may take days" annotating a
24 hour budget -- because neither duration is a function of health. A dump advances
one bounded slice per scheduling round: the storage server returns after
SS_BULKDUMP_BATCH_COUNT_MAX_PER_REQUEST batches and the remainder is re-dispatched
on a later round, so a range that begins life as a single shard needs far more
rounds than the budget allows. A restore's duration likewise tracks the data it
moves.

Measured on a narrow-fleet simulation where the first location read returns one
shard for the whole key space: seven seeds abort a dump that is demonstrably
progressing -- 47 ranges persisted Complete, the frontier advancing across
re-dispatch rounds -- and report a backup failure for it. Since #13936 that
failure is no longer silent, which is what made this visible.

Time out on absence of progress instead, keeping the knobs as the no-progress
window so a genuinely wedged job is still caught. The restore monitor already
computes the task counters it needs for its own status display. The dump monitor
has no such counter, so it samples getBulkDumpCompleteTaskCount at a tenth of the
window -- that call walks the job's metadata and cannot run at poll frequency --
and treats a failed sample as carrying no information, neither failing the backup
nor extending its deadline.

Seven previously failing seeds now complete the dump; twenty paired seeds show no
regression.
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.

4 participants