Repository navigation
Description
backup::tests::the_reconciler_resumes_a_dead_manifest_restore_with_its_spool_host in crates/engine/src/backup/tests.rs fails some CI runs:
panicked at crates/engine/src/backup/tests.rs:16396:5:
assertion `left == right` failed
left: []
right: [(1, 0, true, 2)]
Run that failed:
- perf(storage-cassandra): the legacy restore copy writes through put_restored_item_at instead of the LWT path #527 at e0df8f0, run 43619839118 attempt 1,
mongodb-rust, 2026-11-14 17:29 UTC, with 866 other engine lib tests passing. perf(storage-cassandra): the legacy restore copy writes through put_restored_item_at instead of the LWT path #527 changes no file in crates/engine.
Cause
The test builds runtime2 with job_settings(), which gives each job a heartbeat period of 50 ms in the settings. A resumed job must see its claim confirmed within two periods, 100 ms, before its first download. The job reads that confirmation in crates/engine/src/backup/restore/download.rs line 134 and heartbeat.rs lines 336 to 340. The window starts when claim_restore_dead returns inside the reconciler cycle (reconciler.rs line 991).
Before that first read, the cycle does three more catalog reads and lists the spool, then spawns the job. The test then runs its assertions and the 5 ms sleep of wait_for_jobs. Then the job reads the manifest, removes the stale spool entry and sets up its spool. The first beat comes 50 ms after the job starts, and only when the job yields. When that work takes more than 100 ms, the job stops with ClaimLost ("no heartbeat confirmed the claim recently enough to download data/000002.json.gz"). It leaves the record RUNNING and loads nothing, so bulk_load_files() is empty at line 16396.
The stop itself is the intended behaviour. a_resumes_first_beat_is_the_takeovers_return (line 18651) asserts it when the test holds the read after the takeover for three periods. Production runs a 15 s period, a 30 s window.
Measured on this host at 95425f5
- The test alone, 200 runs: 0 failures.
- The
backup::testsmodule, 20 runs: the test never failed. One run made during a build in the same lane failed three other spooled tests the same way. In each, a job stopped before its first download:a_resume_downloads_the_spool_files_a_crash_left_unverified,an_s3_restore_spools_every_file_and_removes_its_entry_at_the_endanda_resume_that_fails_before_it_runs_removes_this_hosts_spool_entry. - With a 150 ms
std::thread::sleepafter the secondcycle_on(line 16377): 10 failures in 10 runs, with the CI panic and the stop line above.
Proposed fix
Build runtime2 (line 16343) with a heartbeat of 1 s, as a_file_replaced_between_the_two_passes_fails_in_the_load (line 18072) does for the same reason. With that change, the test passed 200 runs alone and 20 runs with the 150 ms sleep. No module run in 20 failed.
A 1 s heartbeat in spooled_runtime (line 14628) would cover all 22 spooled tests, including the three above. a_job_that_learnt_the_record_is_anothers_leaves_its_spool_entry (line 17437) waits for a beat, so it would take up to 1 s longer. That variant was not run.
Activity
LeeroyHannigan commentedon Nov 19, 2026
Another spooled test failed the same way in CI:
backup::tests::a_marker_naming_another_digest_has_its_file_downloaded_again. It ran on #526 at c38b722, a commit that changes onlydocs/manuals/07-upgrade-manual.mdon top of 017335d, where the same job passed. It failed in run 44618952049, attempt 1, jobmongodb-rust, at 2026-11-19 21:47 UTC, with 876 other engine lib tests passing:The test builds its
runtime2withspooled_runtime(line 14609 at that head), so the 1 s heartbeat proposed above forspooled_runtimecovers it. In this run the job got as far as the GET ofdata/000001.json.gz, because the assertion before line 17879 passed, and then it loaded nothing. A lost heartbeat stops a job at that point withClaimLost(restore/download.rslines 143 and 187,restore/load.rslines 185 and 245). The test output has no stop line, so this run does not confirm the reason.test(backup): give the spooled test runtimes a 1 s heartbeat (ExtendD…