Repository navigation
Fix flaky test 05304_json_shared_typed_paths_replication_backup: sync replica p2 before reading it - #127914
Conversation
…plication_backup Replica p2 gets rows 0..19 only through an asynchronous GET_PART of the part inserted into p1. alter_sync = 2 waits for the ALTER_METADATA entry, which the replication queue does not order after an earlier GET_PART, and the test synced only p1. When the fetch took longer than the ~2 s before the p2 reads (4.2 / 7.9 / 13.1 s in the failing arm_asan_ubsan azure runs, during a cached_azure write stall), p2 was read with only its own 20 rows and the four p2 comparisons with the Memory table returned 0. SYSTEM SYNC REPLICA p2 waits for every queued entry, including that fetch, the same way the first section already syncs r2 before reading it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review of the diff (0 findings).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-8:20261027-063500 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261027-062200 |
|
Workflow [PR], commit [edbc6b8] Summary: ✅ AI ReviewSummaryThe PR adds Final VerdictStatus: ✅ Approve. |
|
cc @tavplubix, could you review this and add the |
1d34e67
Related: #127000
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix the flaky test
05304_json_shared_typed_paths_replication_backup, which read replicap2before it had fetched the part inserted intop1.Description
Since #127000 merged,
05304_json_shared_typed_paths_replication_backuphas failed inStateless tests (arm_asan_ubsan, azure, parallel)on 3 unrelated PRs (#120906, #98670, #123968). Each time the fourp2comparisons print0.Replica
p2gets rows 0..19 only through an asynchronous fetch of the part inserted intop1. Nothing waits for that fetch:alter_sync = 2waits for theALTER_METADATAentry, not for an earlierGET_PART, and the test syncs onlyp1. In the failing runs the fetch took 4.2 / 7.9 / 13.1 s (system.part_log) during a write stall on thecached_azuredisk, sop2was read with only its own 20 rows. In a passing run the fetch takes ~0.1 s.The test now runs
SYSTEM SYNC REPLICA p2next toSYSTEM SYNC REPLICA p1, as it already does forr2in its first section.Validation on a debug build of master
9a348d8c282: withSYSTEM STOP FETCHES p2delaying the fetch until after the reads, the unmodified test fails 3/3 with exactly the CI diff. With the fix and the fetch delayed by 10 s, it passes 3/3, andSYSTEM SYNC REPLICA p2waits ~9.6 s for the fetch. 50/50 randomized runs of the fixed test pass.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/127914]
Version info
26.11.1.843-master(included in26.11and later)