Repository navigation
Fix flaky test_s3_plain_rewritable: opt in to legacy REPLACE PARTITION from empty source - #108350
Conversation
…N from empty source When a node's random row count (random.randint(1, MAX_ROWS)) is 1, only id=0 exists, so partition 1 of `test` is empty. After MOVE PARTITION 0 TO test_dst, `test` is empty and REPLACE PARTITION 1 FROM test reads an empty source partition. ClickHouse#23727 (PR ClickHouse#104939) made REPLACE PARTITION from an empty source partition throw BAD_ARGUMENTS by default, gated by allow_replace_partition_from_empty_source. That PR updated the affected stateless tests but missed this integration test, which then failed intermittently (~0.05% of master runs across asan/tsan/msan once ClickHouse#104939 merged). Pin allow_replace_partition_from_empty_source=1 on the REPLACE query to restore the legacy no-op semantics the test relies on, matching the fix applied to the stateless tests in ClickHouse#104939. The destination partition 1 is also empty here, so no data is lost. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-0:20260624-040200 |
|
cc @CheSema — follow-up to #104939: that PR made empty-source |
|
Workflow [PR], commit [6310f67] Summary: ✅ AI ReviewSummaryThis PR fixes the Final VerdictStatus: ✅ Approve |
| count_part_1 = int(node.query("SELECT count(*) FROM test WHERE id % 10 = 1")) | ||
| node.query("ALTER TABLE test_dst REPLACE PARTITION 1 FROM test") | ||
| # Source partition 1 is empty when this node's random row count was 1 (only id=0). | ||
| # Opt in to the legacy no-op semantics; #23727 made empty-source REPLACE PARTITION throw by default. |
There was a problem hiding this comment.
…r change), keep ClickHouse#23727 as original issue Per review on PR ClickHouse#108350: ClickHouse#104939 (the fix for ClickHouse#23727) introduced the empty-source REPLACE PARTITION throw-by-default; reference it so future readers find the actual behavior change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 275 line(s), 50 function(s) across 104 file(s) · Details Top files
|
Cherry pick #108350 to 26.6: Fix flaky test_s3_plain_rewritable: opt in to legacy REPLACE PARTITION from empty source
…to legacy REPLACE PARTITION from empty source
Backport #108350 to 26.6: Fix flaky test_s3_plain_rewritable: opt in to legacy REPLACE PARTITION from empty source
…r change), keep ClickHouse#23727 as original issue Per review on PR ClickHouse#108350: ClickHouse#104939 (the fix for ClickHouse#23727) introduced the empty-source REPLACE PARTITION throw-by-default; reference it so future readers find the actual behavior change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ain-rewritable-replace-empty-partition Fix flaky test_s3_plain_rewritable: opt in to legacy REPLACE PARTITION from empty source
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Fixes flaky
test_s3_plain_rewritable/test.py::test.#104939 (fixing the silent data loss in #23727) made
ALTER TABLE ... REPLACE PARTITION ... FROM ...from a source that has no parts in the requested partition throwBAD_ARGUMENTSby default, gated behind the newallow_replace_partition_from_empty_sourcesetting. It updated the affected stateless tests but missed this integration test.The test inserts
random.randint(1, MAX_ROWS)rows with consecutive ids (PARTITION BY id % 10). When a node draws a row count of 1, onlyid=0exists, so partition 1 oftestis empty. The test then doesMOVE PARTITION 0 TO test_dst(emptyingtest) followed byREPLACE PARTITION 1 FROM test, which now reads an empty source partition and throws.This surfaced as a low-rate flake (~0.05% of master runs) across the asan/tsan/msan integration builds within hours of #104939 merging.
Fix: pin
allow_replace_partition_from_empty_source = 1on theREPLACE PARTITIONquery to restore the legacy no-op semantics the test relies on, matching the fix applied to the stateless tests in #104939. The destination partition 1 is also empty at that point, so no data is lost and the existing assertions (count_dst > 0,count_dst == count_part_0 + count_part_1) still hold.CI report (one of the failures): https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=105387&sha=fb91a686249e35a738fd3be8f2fb480dc39ddc95&name_0=PR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%204%2F6%29
Version info
26.7.1.85(included in26.7and later)26.6.2.10