Skip to content

Disable parallel replicas for 01891_not_in_partition_prune - #107362

Merged
nickitat merged 2 commits into
ClickHouse:masterfrom
groeneai:fix-01891-no-parallel-replicas
Jun 15, 2026
Merged

nickitat merged 2 commits into
ClickHouse:masterfrom
groeneai:fix-01891-no-parallel-replicas

Conversation

@groeneai

@groeneai groeneai commented Jun 12, 2026 •

Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...

Description

01891_not_in_partition_prune fails with TOO_MANY_ROWS under the parallel replicas test configuration.

Reported by @ alexey-milovidov on #100160 (the failure is unrelated to that PR; fixed here in a separate PR as requested).

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100160&sha=ae96ef4318ca38c20e533cd29ddf9719a38d410e&name_0=PR&name_1=Stateless%20tests%20%28amd_llvm_coverage%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29

Root cause. The test sets a tight max_rows_to_read = 5 and relies on single-node row accounting for the NOT IN subquery queries (lines 26-27). With parallel replicas the subquery source table is read on every replica, so the coordinated rows-to-read count exceeds the limit and the query fails with Code: 158 ... current rows: 6.00 ... While executing Remote (TOO_MANY_ROWS).

This is the same per-replica accounting behavior already handled in 00971_merge_tree_uniform_read_distribution_and_max_rows_to_read, which carries the no-parallel-replicas tag.

Fix. Add the no-parallel-replicas tag so the test is excluded from the ParallelReplicas job and the settings randomizer does not enable parallel replicas for it. The partition-pruning and NOT IN optimization checks continue to run on a single node, unchanged.

CI history (120 days) shows this failure across the parallel-replicas coverage configuration on #100160, #104233, #103246, #97261, and once via the regular-job randomizer on #99181.

Version info

  • Merged into: 26.6.1.821

The test sets a tight max_rows_to_read = 5 and relies on single-node row
accounting for the NOT IN subquery queries. With parallel replicas the
subquery source table is read on every replica, so the coordinated
rows-to-read count exceeds the limit (6 rows with parallel_replicas_local_plan
off, up to 8 with parallel_replicas_min_number_of_rows_per_replica = 1) and the
query fails with TOO_MANY_ROWS "While executing Remote".

This is the same per-replica accounting behavior already handled in
00971_merge_tree_uniform_read_distribution_and_max_rows_to_read, which carries
the no-parallel-replicas tag. Apply the same tag here so the test is excluded
from the ParallelReplicas job and the settings randomizer does not enable
parallel replicas for it, while the partition-pruning and NOT IN optimization
checks continue to run on a single node.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate

# Question Answer
a Deterministic repro? Yes. Local server with a 3-replica pr_test_cluster (loopback 127.0.0.1-3, tcp_port set so is_local=1). select date,a,b from t1 where (date,a,b) NOT IN (select date,a,b from t2) with enable_parallel_replicas=1, cluster_for_parallel_replicas=pr_test_cluster, max_parallel_replicas=3, max_rows_to_read=5 fails 100% with Code: 158 ... current rows: 6.00 ... While executing Remote (TOO_MANY_ROWS) — the exact CI signature.
b Root cause explained? The test sets max_rows_to_read = 5 and relies on single-node row accounting for the NOT IN subquery. With parallel replicas the subquery source table is read on every replica, so the coordinated rows-to-read count exceeds 5 (6 rows with parallel_replicas_local_plan=0, up to 8 with parallel_replicas_min_number_of_rows_per_replica=1), raising TOO_MANY_ROWS. With parallel replicas disabled the same query reads within the limit and passes.
c Fix matches root cause? Yes. The failure is intrinsic to running this tight-limit test under parallel replicas (read amplification varies 6..8 across PR settings, so no single setting pin suffices). The no-parallel-replicas tag excludes it from the ParallelReplicas job and stops the settings randomizer from enabling PR for it. Same fix already used for the sibling test 00971_merge_tree_uniform_read_distribution_and_max_rows_to_read.
d Test intent preserved / new tests added? Yes. The test still runs on a single node in every other job: partition pruning and the NOT IN optimization checks are unchanged. The .reference is unchanged (not echo-mode). Confirmed the full test SQL on a single node produces output identical to .reference.
e Both directions demonstrated? Yes. Without the tag, PR settings reproduce current rows: 6.00 ... While executing Remote. With parallel replicas disabled (which the tag enforces in PR jobs), the test passes and matches .reference.
f Fix is general, not a narrow patch? N/A for the engine, but verified for the test scope: this is a test-only flaky-config fix (no C++ change). CIDB confirms all ParallelReplicas-config failures (#100160, #104233, #103246, #97261) share the identical signature, and the regular-job randomizer hit (#99181) is covered by the same tag. The non-PR Fast test failures in the history are distinct PR-caused regressions, not this issue.

Session id: cron:clickhouse-worker-slot-1:20260612-183700

@groeneai groeneai mentioned this pull request Jun 12, 2026
1 task done
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @nickitat — could you review this? Test-only fix: 01891_not_in_partition_prune sets a tight max_rows_to_read = 5 and relies on single-node row accounting, but under parallel replicas the NOT IN subquery source is read on every replica and the coordinated count exceeds the limit (TOO_MANY_ROWS). Adds the no-parallel-replicas tag, same as the sibling test 00971.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Jun 12, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4ec3557]

Summary: ✅


AI Review

Summary

This PR adds the no-parallel-replicas tag to 01891_not_in_partition_prune.sql, excluding a tight max_rows_to_read test from ParallelReplicas execution and from the random automatic_parallel_replicas_mode path. The change matches existing clickhouse-test tag handling and the referenced failure mode; I found no blocking correctness, safety, or metadata issues.

Final Verdict

Status: ✅ Approve

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finished on b5fd286. Single failure, not PR-caused:

  • Fast test (arm_darwin) / 04336_parallel_blocks_marshalling_low_cardinality_native_format — chronic arm_darwin infra flake (Code: 209 Timeout: connect timed out: 127.0.0.2:90, a loopback-shard connection timeout). 8 distinct PRs / 0 master in 30d; unrelated to this PR, which only adds a no-parallel-replicas tag to 01891_not_in_partition_prune.sql. Tracked separately.

All functional / build / flaky-check jobs are green. Mergeable Check and PR are red only because they aggregate the arm_darwin job above.

Session id: cron:our-pr-ci-monitor:20260613-000000

@clickhouse-gh

clickhouse-gh Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.70% 84.80% +0.10%
Functions 92.30% 92.40% +0.10%
Branches 77.30% 77.30% +0.00%

Changed lines: No C/C++ source files changed — skipping uncovered code analysis.

Newly covered by added/modified tests: 854 line(s), 70 function(s) across 137 file(s) · Details

Top files
  • src/Server/ACME/Client.cpp: 198 line(s), 9 function(s)
  • src/Server/ACME/API.cpp: 160 line(s), 15 function(s)
  • src/Common/OpenSSLHelpers.cpp: 52 line(s), 2 function(s)
  • src/Common/Crypto/KeyPair.cpp: 28 line(s), 5 function(s)
  • src/Server/CertificateReloader.cpp: 24 line(s), 2 function(s)

Full report

@nickitat
nickitat added this pull request to the merge queue Jun 15, 2026
Merged via the queue into ClickHouse:master with commit 962f214 Jun 15, 2026
166 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants