Repository navigation
test(storage-sqlite): skip a file that goes between the listing and the read - #1113
Conversation
…he read SQLite deletes the WAL and its index when the last connection closes, and pool.close() can return before that. In 30 local runs, both files were still there right after close() returned in 1 run. The secure-delete test lists the catalog directory and then reads each file, so a file that went in between failed the test with NotFound. The store checkpoints and truncates the WAL after each overwrite, so a WAL that goes holds no page. The helper now skips a file that is gone, and it still fails on any other read error.
eliseong
left a comment
There was a problem hiding this comment.
LGTM.
I built this head as a SQLite server and ran a_pass_leaves_no_catalog_key_and_no_old_ciphertext_in_the_files twenty times: all green. files() now skips a file that returns NotFound between the listing and the read, and still fails on any other read error, which keeps a real retained-secret file from passing silently. cargo fmt --check and cargo clippy -p extenddb-storage-sqlite --all-targets -- -D warnings are clean.
The change is 15 commits behind main, but the file has not moved upstream since this branch's base, so it rebases clean.
This resolves #1132. The body has no closing keyword, so #1132 will not close on merge; add Closes #1132 if you want that.
|
Correction to my review: the body already has |
|
@eliseong Your first note was right. The body had no closing keyword when you reviewed it. I added |
What
The SQLite secure-delete test,
a_pass_leaves_no_catalog_key_and_no_old_ciphertext_in_the_files, reads every file in the catalog directory after its pool closes. Its helperfiles()now skips a file that SQLite deletes between the listing and the read. Any other read error still fails the test.Why
The test failed in CI on #1003 with
read a file: ... NotFound(run 44224988341, attempt 2). SQLite deletes the WAL and its shared-memory index when the last connection closes.pool.close()can return before that.A file that goes holds no bytes that the test must search. The store checkpoints and truncates the WAL after each overwrite (
PRAGMA wal_checkpoint(TRUNCATE)), so a WAL that goes holds no page.Follows #1003, which added the test. Closes #1132, which reports the same failure on #1130.
Testing done
close()returned. The commit does not have those lines. 30 passed. In 1 run, the WAL and its index were still there afterclose()returned.management_store::secret_rowstests ofextenddb-storage-sqlite: 3 passed.cargo fmt --all -- --check, andcargo clippy -p extenddb-storage-sqlite --all-targets -- -D warningsunder the toolchain CI pins: clean.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.