Type of problem
Bug report - something's broken
Describe the situation
01710_projection_additional_filters is flaky on stable-25.8 in the ParallelReplicas config (6 fails / 14 OKs; 0 fails in all other configs). When it fails, count() returns more rows than exist:
select count() from atf_p settings additional_table_filters = {'atf_p': 'x <= 2'}; -- table has 10 rows (0..9)
-- expected 3, got 23
Under parallel replicas the minmax_count_projection path returns an unfiltered count that gets summed with the correctly-filtered count (23 = unfiltered + filtered), so additional_table_filters produces wrong aggregates. This is a genuine data-correctness bug, not just a test artifact.
Not Altinity-specific. The test is identical to 25.8.24 (unchanged), and the same flakiness exists on upstream master (44 fails / 3282 OKs). Upstream diagnosed it (same unfiltered + filtered pattern) in ClickHouse#104219 and fixed it in ClickHouse#104296 2026-05-20). That fix is not on the 25.8 line: the direct backport to upstream 25.8 (ClickHouse#105421) was closed, and upstream only stabilized the 04201 test (ClickHouse#108904, already present here) without taking the code fix. So the correctness fix is absent in both upstream 25.8 and Altinity stable-25.8. Began surfacing on Altinity at the 25.8.28 bump (PR #2024, 2026-07-10); upstream 25.8 CI does not run the ParallelReplicas stateless config, so it stays latent there.
How to reproduce
Expected behavior
count() with additional_table_filters returns the filtered count (3).
Actual behavior
Returns unfiltered+filtered sum (23, 13, ...), intermittently.
Suggested fix
- Backport upstream ClickHouse#104296 ("Disable additional_table_filters with parallel replicas and analyzer and w/o query plan serialization") — the real correctness fix. Small (
src/Planner/Planner.cpp +22, plus 04201/04207 test refs) and feasible (serialize_query_plan setting exists on 25.8). Note: upstream deliberately did not backport it to 25.8, so this is an Altinity-specific divergence, and it conflicts with the 04201 stabilization already in the branch.
- Mark the test as broken for the ParallelReplicas config in
tests/broken_tests.yaml (applied as the interim mitigation, referencing this issue) so CI is not blocked by the flaky wrong-result while the backport decision is made.
Type of problem
Bug report - something's broken
Describe the situation
01710_projection_additional_filtersis flaky onstable-25.8in theParallelReplicasconfig (6 fails / 14 OKs; 0 fails in all other configs). When it fails,count()returns more rows than exist:Under parallel replicas the
minmax_count_projectionpath returns an unfiltered count that gets summed with the correctly-filtered count (23 = unfiltered + filtered), soadditional_table_filtersproduces wrong aggregates. This is a genuine data-correctness bug, not just a test artifact.Not Altinity-specific. The test is identical to 25.8.24 (unchanged), and the same flakiness exists on upstream
master(44 fails / 3282 OKs). Upstream diagnosed it (sameunfiltered + filteredpattern) in ClickHouse#104219 and fixed it in ClickHouse#104296 2026-05-20). That fix is not on the 25.8 line: the direct backport to upstream 25.8 (ClickHouse#105421) was closed, and upstream only stabilized the04201test (ClickHouse#108904, already present here) without taking the code fix. So the correctness fix is absent in both upstream 25.8 and Altinity stable-25.8. Began surfacing on Altinity at the 25.8.28 bump (PR #2024, 2026-07-10); upstream 25.8 CI does not run the ParallelReplicas stateless config, so it stays latent there.How to reproduce
stable-25.8(25.8.28)Expected behavior
count()withadditional_table_filtersreturns the filtered count (3).Actual behavior
Returns unfiltered+filtered sum (
23,13, ...), intermittently.Suggested fix
src/Planner/Planner.cpp+22, plus04201/04207test refs) and feasible (serialize_query_plansetting exists on 25.8). Note: upstream deliberately did not backport it to 25.8, so this is an Altinity-specific divergence, and it conflicts with the04201stabilization already in the branch.tests/broken_tests.yaml(applied as the interim mitigation, referencing this issue) so CI is not blocked by the flaky wrong-result while the backport decision is made.