Skip to content

test(storage-sqlite): wait for restore slot to be freed after copy finishes - #882

Draft
Dodothereal wants to merge 1 commit into
ExtendDB:mainfrom
Dodothereal:fix/872-sqlite-restore-slot-race
Draft

Dodothereal wants to merge 1 commit into
ExtendDB:mainfrom
Dodothereal:fix/872-sqlite-restore-slot-race

Conversation

@Dodothereal

Copy link
Copy Markdown

Summary

Fixes #872. In crates/storage-sqlite/src/backup.rs, the test backup::restore_tests::reconciler_fencing::a_running_restore_holds_its_slot_and_is_not_listed_dead_by_its_heartbeat occasionally failed in CI with:
the slot is freed with the claim when the copy ends

wait_for_copy returns as soon as the target table status is committed to ACTIVE. The job slot is freed slightly later when the restore task's claim in crates/storage-sqlite/src/backup_catalog.rs is dropped. An immediate check on engine.job_slots.holds(&slot) can therefore race with the cleanup.

This change waits with a 30-second deadline for the slot to be freed, matching the pattern already used in the same test module.

Validation

  • cargo fmt --check passed.
  • set -o pipefail && cargo test -p extenddb-storage-sqlite --lib a_running_restore_holds_its_slot_and_is_not_listed_dead_by_its_heartbeat passed (1 passed in 0.43s).

Provenance

Prepared with AI assistance (Gemini 3.8 Flash) under contributor authorization. Draft status preserved pending review.

…nishes

Fixes ExtendDB#872. In a_running_restore_holds_its_slot_and_is_not_listed_dead_by_its_heartbeat,
wait_for_copy returns as soon as the target table status is committed to ACTIVE.
The job claim is dropped slightly later when the task cleans up, so an
immediate check on engine.job_slots.holds(&slot) can see the slot still held.
Wait with a 30s deadline matching the pattern used in the same test module.

This branch has not been deployed

No deployments
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.

storage-sqlite: a restore slot test checks the slot before the copy frees it

1 participant