Skip to content

test(storage-cassandra): widen the delays of the GSI pass test - #1001

Merged
LeeroyHannigan merged 1 commit into
mainfrom
fix/990-gsi-pass-delays
Nov 20, 2026
Merged

LeeroyHannigan merged 1 commit into
mainfrom
fix/990-gsi-pass-delays

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

What

pass_reads_images_of_due_rows_only_and_reports_earliest_due in crates/storage-cassandra/tests/direct/gsi_worker_pass.rs now 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_ms in workers.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.
  • The test needs a Cassandra node, and I did not run it on this host. The cassandra-storage CI job runs it.

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, 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.

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 eliseong left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeeroyHannigan

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_ms checks 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.

@eliseong
eliseong added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@LeeroyHannigan
LeeroyHannigan added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 64ad21d Nov 20, 2026
58 checks passed
@LeeroyHannigan
LeeroyHannigan deleted the fix/990-gsi-pass-delays branch November 20, 2026 16:16
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.

Flaky: pass_reads_images_of_due_rows_only_and_reports_earliest_due needs phase 2 within 30 s of phase 1

2 participants