Repository navigation
test(storage-cassandra): widen the delays of the GSI pass test - #1001
Conversation
pass_reads_images_of_due_rows_only_and_reports_earliest_due failed once in CI at its setup check for phase 2. The earliest row of a worker partition was still one of account 0's rows, not one of account 2's. A row's delay is drawn between half the set delay and the full delay. Account 0's rows were due in 30 to 60 s, and account 2's rows, queued in phase 2, in 15 to 30 s. So account 2's rows were the earliest only when phase 2 started within about 15 s of account 0's rows. Between the two, the test runs the rest of phase 1's puts, two passes of every worker and the queue reads. On a loaded runner, that took longer. The test now sets 3,600 s for account 0, 7,200 s for account 1 and 300 s for account 2. The order of the three accounts is the same. Account 2's rows are the earliest as long as phase 2 starts within 1,500 s of account 0's rows. A pass reports the earliest queued row whatever its delay, so the rest of the test checks the same things. Fixes #990
eliseong
left a comment
There was a problem hiding this comment.
LGTM
The wider delays fix the failure of run 43619460199. I ran the test on a Cassandra 4.1 node with all CPU cores busy, alternating between the two branches.
- On main, 2 of 15 runs failed at line 140 with "phase 2: the earliest row of partition 3 is in account 0, not in account 2, which this phase needs". On this branch, 15 of 15 passed.
- With a 31 s stop before phase 2, main failed 2 of 2 and this branch passed 2 of 2.
- The
next_due_mschecks still work. A pass that keeps the next due time of the last keyspace fails phase 1, and a pass that keeps the first keyspace's fails phase 2. - cargo fmt and clippy with -D warnings are clean, with and without
--features test-hooks.
One note, not a merge condition. The test now finds a pass that reads item images of rows that are not yet due only when the pass reads 150 s or more ahead. On main it found a read-ahead of 15 s. I changed run_gsi_pass in workers.rs to read the images of rows due in the next 60 s and to apply only the due rows. On main the test fails with "phase 1: a pass read the item images of 51 queued rows; only the 1 due row needs them (100 were not due)". On this branch it passes. Please add a line to the doc comment that states this limit, in this PR or a later one.
What
pass_reads_images_of_due_rows_only_and_reports_earliest_dueincrates/storage-cassandra/tests/direct/gsi_worker_pass.rsnow queues its rows with longer delays: 3,600 s for account 0, 7,200 s for account 1 and 300 s for account 2. The order of the three accounts stays the same. Only the test changes.Why
Closes #990
The test failed once in CI on #398 (run 43619460199), at its own setup check for phase 2. The earliest row of partition 1 was still in account 0, not in account 2.
A queued row's delay is drawn between half the set delay and the full delay. Account 0's rows were due in 30 to 60 s, and account 2's rows in 15 to 30 s. So account 2's rows were the earliest only when phase 2 started within about 15 s of account 0's rows. Between the two, the test runs the rest of phase 1's puts, two passes of every worker and the queue reads. On a loaded runner that took longer.
With the new delays, account 2's rows are the earliest as long as phase 2 starts within 1,500 s of account 0's rows. A pass reports the earliest queued row whatever its delay (
next_due_msinworkers.rs), so the rest of the test checks the same things.Testing done
cargo +1.97.0 fmt --all -- --check: no changes.cargo +1.97.0 clippy -p extenddb-storage-cassandra --all-targets --features extenddb-storage-cassandra/test-hooks -- -D warnings: no warnings.cassandra-storageCI job runs it.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.