Repository navigation
test(backup): accept a DELETING restore target while the cell waits for it to go - #994
Merged
Merged
Conversation
…or it to go _wait_table_gone failed on any status other than CREATING. On PostgreSQL, abort_restore sets a failed restore's target to DELETING before it drops the data and deletes the row. A DescribeTable poll in that window failed test_a_tampered_data_file_fails_the_restore_before_any_item in run 43619460425. The helper now accepts CREATING and DELETING. Neither status is writable, and the assertion checks that the target never became writable. Fixes #993
LeeroyHannigan
requested review from
amrith,
c33howard,
eliseong,
hitesh96db,
jcshepherd,
navareamol,
pdf-amzn and
robinnsc
as code owners
November 14, 2026 17:47
eliseong
approved these changes
Nov 20, 2026
eliseong
left a comment
Collaborator
There was a problem hiding this comment.
LGTM
I ran the tampered-file cell on PostgreSQL 16 on a loaded Linux host, 12 runs on each side with one server build.
- With the helper from main, 12 of 12 runs failed with "tamper--r is DELETING, it was never writable". This is the failure of run 43619460425.
- With this branch, 12 of 12 runs passed.
The DELETING state is expected. PostgreSQL's abort_restore commits DELETING, then drops the data, then deletes the row (backup_engine.rs:957-998). SQLite removes the row and the data in one transaction, so it never shows DELETING. The helper still fails on ACTIVE and on any other status.
The change covers all three cells that call _restore_fails: the tampered file, the duplicate key across files and key_range. No other wire test waits for a failed restore's target with a status check that rejects DELETING.
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
_wait_table_goneintests/test_backup_job.pynow accepts a target that answersDELETINGwhile the helper waits for the target to go. Before this change it failed on any status other thanCREATING.Why
Closes #993
On PostgreSQL,
abort_restoresets a failed restore's target toDELETINGbefore it drops the data and deletes the row. ADescribeTablepoll in that window failedtest_a_tampered_data_file_fails_the_restore_before_any_itemin run 43619460425 (#398,run-integration (2)). The helper polls every 0.2 s, so the cell failed only when a poll landed in the window.The assertion is there to catch a target that became writable. A
DELETINGtable is not writable either, so the helper still fails onACTIVEor on any other status.Testing done
python3 -m py_compile tests/test_backup_job.py: no errors.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.