Skip to content

Backup: time bulkdump and bulkload jobs out on absence of progress - #13945

Merged
saintstack merged 1 commit into
apple:mainfrom
saintstack:bulkdump-bulkload-progress-timeout
Aug 26, 2026
Merged

saintstack merged 1 commit into
apple:mainfrom
saintstack:bulkdump-bulkload-progress-timeout

Conversation

@saintstack

Copy link
Copy Markdown
Contributor

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.

20260825-190030-stack_misc-98e6eef2c4d4a0bc compressed=True data_size=38725762 duration=3749156 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=0:32:50 sanity=False started=100000 stopped=20260825-193320 submitted=20260825-190030 timeout=5400 username=stack_misc

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 apple#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.
@foundationdb-ci

Copy link
Copy Markdown
Contributor

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

  • Commit ID: 4b7cfec
  • Duration 0:46:42
  • 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: 4b7cfec
  • Duration 0:48:23
  • 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: 4b7cfec
  • Duration 1:09:13
  • 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: 4b7cfec
  • Duration 1:20:33
  • 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: 4b7cfec
  • Duration 1:22: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-cluster-tests on Linux RHEL 9

  • Commit ID: 4b7cfec
  • Duration 1:40:40
  • 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)

@foundationdb-ci

Copy link
Copy Markdown
Contributor

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

  • Commit ID: 4b7cfec
  • Duration 4:12:38
  • Result: ❌ FAILED
  • Error: `Error while executing command: # compatible with bash and zsh
    ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key
    -o ServerAliveInterval=9 ec2-user@${MAC_EC2_HOST} "
    set -e -o noclobber
    BUILDNUM=${CODEBUILD_BUILD_NUMBER}
    WAIT_TIME=14400 # 4 hours
    LOCK_STALE=4500 # 75 minutes
    LOCK=/tmp/ci.lock
    "'

macOS stat flags, not linux compatible

lock_mtime() { stat -f %m $LOCK || echo 0 }
I=0
while ! (echo $BUILDNUM >$LOCK) 2>/dev/null ; do
if (( ++I >= WAIT_TIME )); then
echo "timeout waiting for ci.lock after $I seconds"
exit 1
fi
if (( $(date +%s) - $(lock_mtime) >= LOCK_STALE )); then
echo "lock expired after $LOCK_STALE seconds ..."
# racy but sleep so chances are low
sleep $(( 3 + RANDOM % 8 ))
if (( $(date +%s) - $(lock_mtime) >= LOCK_STALE )); then
echo "lock holder is gone"
rm -f $LOCK
else
echo "new lock holder"
fi
fi
sleep 1
done
echo "acquired ci.lock"
'
. Reason: exit status 1`

  • Build Log terminal output (available for 30 days)
  • Build Workspace zip file of the working directory (available for 30 days)

@akankshamahajan15 akankshamahajan15 left a comment

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.

LGTM

@saintstack
saintstack merged commit 40cd46c into apple:main Aug 26, 2026
3 checks passed
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.

3 participants