Repository navigation
test(backup): give the spooled test runtimes a 1 s heartbeat - #997
Merged
Merged
Conversation
the_reconciler_resumes_a_dead_manifest_restore_with_its_spool_host failed once in CI. After wait_for_jobs, bulk_load_files() was empty. The resumed job stopped as a lost claim before its first download, so it recorded no load and its task ended. The engine tests run jobs at the 50 ms heartbeat of job_settings. A job accepts a last confirmed beat at most two periods old, here 100 ms, before each store or table access. A resumed job's first confirmed beat is the takeover's return inside the reconciler cycle. Between that return and the job's first read of the beat come: - the rest of the cycle: the maintenance claim re-read, the record, progress and target readiness reads, and the spool listing - the test's own assertions and the 5 ms sleep of wait_for_jobs - the job's manifest and sidecar reads, the removal of the stale spool entry and the fsynced writes of both documents into the new one. On a loaded runner that span passed 100 ms before the timer's first beat. The job stopped with "no heartbeat confirmed the claim recently enough to download data/000002.json.gz". A 150 ms stall of the test thread after the takeover reproduces the failure on every run. Three other spooled tests failed the same way in one of 20 runs of the module on a busy host. Each was a job stopped before its first download. spooled_runtime now builds its runtime with a 1 s heartbeat, so every spooled test has a 2 s window. a_file_replaced_between_the_two_passes_fails_in_the_load already runs at 1 s for the same reason. The production period is 15 s and the product does not change. With the 150 ms stall in place the test passed 20 of 20 runs. Without it the test alone passed 200 of 200 runs and the backup::tests module 20 of 20. Fixes #995
LeeroyHannigan
requested review from
amrith,
c33howard,
eliseong,
hitesh96db,
jcshepherd,
navareamol,
pdf-amzn and
robinnsc
as code owners
November 14, 2026 18:39
hitesh96db
approved these changes
Nov 20, 2026
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
spooled_runtimeincrates/engine/src/backup/tests.rsnow builds its test runtime with a 1 s heartbeat instead of the 50 ms ofjob_settings. Every test that callsspooled_runtimegets the 1 s heartbeat. No product code changes.Why
Closes #995
the_reconciler_resumes_a_dead_manifest_restore_with_its_spool_hostfailed once in CI on #527 (run 43619839118). Before each store or table access, a job must see a confirmed beat at most two heartbeat periods old. At the 50 ms heartbeat that is 100 ms. A resumed job's first confirmed beat is the takeover's return inside the reconciler cycle. Before the job reads that beat, the cycle finishes its reads and the test runs its assertions. The job also prepares its spool entry with fsynced writes. On a loaded runner this took more than 100 ms, so the job stopped as a lost claim before its first download and loaded nothing.With a 1 s heartbeat the window is 2 s.
a_file_replaced_between_the_two_passes_fails_in_the_loadalready runs at 1 s for the same reason. The production heartbeat is 15 s.Testing done
On this host, with the engine's library test binary:
backup::testsmodule, 20 runsa_job_that_learnt_the_record_is_anothers_leaves_its_spool_entrywaits for a beat, so it now takes about 1.05 s alone, where it took about 0.1 s.cargo +1.97.0 fmt --all -- --check: no changes.cargo +1.97.0 clippy -p extenddb-engine --all-targets --features extenddb-engine/backup-test-hooks -- -D warnings: no warnings.Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.