Repository navigation
Fix flaky test_rename_distributed_parallel_insert_and_select - #111121
alexey-milovidov merged 1 commit into
Conversation
The cleanup renames back to num2 run ON CLUSTER (async distributed DDL plus async ReplicatedMergeTree metadata replication) with ignore_exception=True, so a failed or late rename is swallowed. The strict final selects then run with no wait for schema convergence. A distributed SELECT for num2 forwarded to a shard replica whose local _replicated metadata has not yet converged (still foo2/foo3) fails with UNKNOWN_IDENTIFIER at the analyzer. This is correct engine behaviour for per-shard schema during async metadata replication; the test asserted before its precondition held. Replace the fixed cleanup renames with wait_for_rename_to_num2, which re-drives the idempotent ON CLUSTER rename-back and polls system.columns until num2 is present on every node before the strict selects, repairing both a swallowed rename and replication lag. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Internal second-model review (click to expand)Two independent review passes before opening this PR. Gate A (approach review) — 1 finding, agreed and addressed:
Gate B (diff review) — 0 findings. Diffstat reviewed: 1 file changed, +32/-8. |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-4:20260720-170100 |
|
cc @tavplubix could you review this? It fixes the flaky |
|
Workflow [PR], commit [51eea39] Summary: ✅ AI ReviewSummaryThis PR replaces the one-shot best-effort rename-back at the end of Final Verdict
|
…uted-parallel-select-flaky Fix flaky test_rename_distributed_parallel_insert_and_select
|
Backporting to fix CI |
Backport #111121 to 26.6: Fix flaky test_rename_distributed_parallel_insert_and_select
Backport #111121 to 26.3: Fix flaky test_rename_distributed_parallel_insert_and_select
…_parallel_insert_and_select
Related: #110970
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes the chronic flaky
test_rename_column/test.py::test_rename_distributed_parallel_insert_and_select(Code: 47 UNKNOWN_IDENTIFIERonamd_msan/amd_tsan).The cleanup renames back to
num2run viaON CLUSTER(async distributed DDL + async ReplicatedMergeTree metadata replication) withignore_exception=True, so a failed or late rename is swallowed. The strict final selects then run immediately with no wait for schema convergence. When a distributedSELECT ... WHERE num2 ...is forwarded to a shard replica whose local_replicatedmetadata has not yet converged tonum2(stillfoo2/foo3), that shard's analyzer throwsUNKNOWN_IDENTIFIER. This is correct engine behaviour (per-shard schema during async metadata replication); the test asserted before its precondition held.Replaces the fixed cleanup renames with
wait_for_rename_to_num2, which re-drives the idempotentON CLUSTERrename-back and pollssystem.columnsuntilnum2is present on every node's Distributed and_replicatedtable before the strict selects. This repairs both a swallowed cleanup rename and async replication lag. Test-only change; strict assertions unchanged.Reproduced deterministically: a local-only
RENAME num2 -> foo2on node1 makes the Distributed schema outrun a shard replica, and a strictSELECT ... WHERE foo2then fails with the exactCode: 47from CI (Received from node4:9000 ... Identifier '__table1.foo2' cannot be resolved); with the wait it passes. Fixed test: 10/10 runs pass.Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110970&sha=b16c36ef0ff5c635f3cd4ffb7175c840a7198cc3&name_0=PR&name_1=Integration%20tests%20%28amd_msan%2C%208%2F8%29
Version info
26.7.1.1254(included in26.7and later)26.6.8.8,26.3.33.92