Skip to content

Do not run six TimeSeries tests with parallel replicas - #123763

Merged
alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/timeseries-tests-no-parallel-replicas
Oct 4, 2026
Merged

alexey-milovidov merged 3 commits into
ClickHouse:masterfrom
groeneai:groeneai/timeseries-tests-no-parallel-replicas

Conversation

@groeneai

@groeneai groeneai commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #118130
Related: #101841 (comment)

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):

Not required: test-only change.

Description

Since #122853, Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) runs on every PR, and five TimeSeries tests fail there on unrelated PRs: #101841 (Table default.ts_new does not exist), #118272 (m1 j1 returned three times). CIDB, that job, since 2026-09-29 (158 runs), PRs other than #122853: 05213_timeseries_metric_families_target 54, 05218_timeseries_alp_codec 26, 05237_time_series_old_metric_family_name_inner_column 11, 05059_time_series_create_as_keeps_settings 5, 04838_timeseries_tags_column_contains_all_tags 3. 05182_time_series_id_type_setting has not failed there yet, but it reads timeSeriesTags like 05059 and fails 5/40 locally with that job's settings, so it is tagged too.

Both causes are the defects of #118130, which is closed but still reproduces on master:

  • The argument of timeSeriesSamples / timeSeriesMetricFamilies reaches the replicas unqualified, so a replica looks the table up in default (05213, 05218, 05237). With the default parallel_replicas_local_plan = 1 this is a race, hence intermittent.
  • Every replica reads the whole table behind timeSeriesTags, so each row comes back once per replica (05059, 04838, 05182, which already pass the database explicitly).

Change: the no-parallel-replicas tag plus one comment line per test, as 0bc5beb did for 05057, which is skipped in all 158 runs of that job. #118518 is the engine fix and can drop these tags when it lands.

Validation on a master debug build:

  • With parallel_replicas_local_plan = 0 and max_parallel_replicas = 3, all six fail untagged and are skipped under --no-parallel-replicas once tagged.
  • Without that flag, the tag's enable_parallel_replicas = 0 makes them pass with the same settings; without the tags they fail.
  • 50/50 randomized runs of each pass.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/123763]

Version info

  • Merged into: 26.10.1.1540-master (included in 26.10 and later)

`Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel)` runs on every PR since
ClickHouse#122853, and five TimeSeries tests fail there on unrelated PRs (CIDB, that job, since 2026-09-29,
147 runs): 05213 51, 05218 26, 05237 10, 05059 6, 04838 4.

Both failure classes are the open defects of the TimeSeries table functions on parallel replicas:
- the argument of `timeSeriesSamples` / `timeSeriesMetricFamilies` is sent to the replicas as it was
  written, and a parallel-replica connection carries no default database, so a replica looks the
  table up in `default` (`UNKNOWN_TABLE`; 05213, 05218, 05237). With the default
  `parallel_replicas_local_plan = 1` this is a race, which is why it is intermittent;
- no replica announces its parts to the coordinator, so every replica reads the whole inner table
  and each row of `timeSeriesTags` comes back once per replica (05059, 04838, which already pass
  the database explicitly).

Same change as 0bc5beb made for 05057: the `no-parallel-replicas` tag plus one line naming
the defect. The engine fix is ClickHouse#118518, which should
drop these tags when it lands.

Related: ClickHouse#118130

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Oct 3, 2026
@groeneai

groeneai commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author
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 (2 nits).

# Sev Finding Verdict Evidence / action
1 💡 The text called the defects of #118130 "open", but the issue is closed AGREE They still reproduce on master; the PR description now says so.
2 💡 04838's tag line names only the duplicated rows; with parallel_replicas_local_plan = 0 it also fails in prometheusQuery AGREE, no change The CI job runs with parallel_replicas_local_plan = 1 and shows only the duplicated rows; the tag covers both.

Severity: ❌ blocker / ⚠️ major / 💡 nit.

Session id: cron:clickhouse-review-slot-9:20261003-212600

@groeneai

groeneai commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes. With enable_parallel_replicas = 1, parallel_replicas_local_plan = 0, max_parallel_replicas = 3, timeSeriesTags(ts) fails Table default.ts does not exist and timeSeriesTags(currentDatabase(), 'ts') returns one row 3 times; the five tests fail 5/5 untagged.
b Root cause explained? The two defects of #118130 (closed, still on master): the table-function argument reaches the replicas unqualified (looked up in default), and every replica reads all rows of the inner table.
c Fix matches root cause? Test-only mitigation. The engine fix is #118518; the tag excludes the tests from the one job where the bug hits them, as 0bc5beb did for 05057. Qualifying the name fixes only the first defect (05059 and 04838 already qualify and still fail).
d Test intent preserved / new tests added? Yes. The tests check TimeSeries semantics, not parallel replicas, and still run in every other job (250/250 randomized runs pass). No source change, so no new test.
e Both directions demonstrated? Yes. Untagged 5/5 FAIL, tagged 5/5 SKIPPED in the ParallelReplicas configuration; with the same settings and no skip, tagged 25/25 OK and untagged 5/5 FAIL.
f Fix is general across code paths? No other TimeSeries or PromQL test fails in that job on PRs other than #122853 (CIDB since 2026-09-29); 05057, 05243, 05047, 04816 are already tagged.
g Fix generalizes across inputs (params/datatypes/wrappers)? N/A (test metadata). Both parallel_replicas_local_plan values are covered: the test is skipped in that job and runs with enable_parallel_replicas = 0 elsewhere.
h Backward compatible? (maintainer-approved exception only) Yes. No setting, format or source change.
i Invariants and contracts preserved? Yes. References are unchanged; only the Tags: line and one comment line per test are added.

Session id: cron:clickhouse-impl-slot-41:20261003-205100

@clickhouse-gh

clickhouse-gh Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [524cac1]

Summary: ✅


AI Review

Summary

This PR adds no-parallel-replicas tags to six TimeSeries stateless tests that currently exercise the two known #118130 failure modes under parallel replicas: unqualified table-function arguments being resolved on replica connections against default, and duplicate reads from timeSeriesTags / timeSeriesMetricFamilies when each replica scans the full inner table. I did not find a remaining correctness gap in the current head: the previously raised missing sibling (05182) is now tagged, and the nearby untagged TimeSeries tests that look similar are safe for code-visible reasons (05217 forces max_parallel_replicas = 1, while 05210 only covers empty-table / DDL-rejection paths).

Final Verdict

✅ No new review findings. The existing bot-authored thread about 05182 remains correctly resolved, so I am not posting a new batched inline review.

@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 3, 2026
It reads `timeSeriesTags({CLICKHOUSE_DATABASE:String}, 'ts')` after one insert and expects one row,
the same pattern as 05059 and 04838, so it hits the duplicated-rows defect of ClickHouse#118130. With
`enable_parallel_replicas = 1, max_parallel_replicas = 10` it failed 5/40 locally at the CI default
`parallel_replicas_local_plan = 1` (`1 m1` returned two or three times) and 5/5 at `local_plan = 0`.
With the tag: 40/40 skipped in the ParallelReplicas job, 40/40 OK with the same options outside it.

The other untagged TimeSeries table-function tests (04613, 04627, 04817, 04836, 04891, 05054, 05210,
05217, 05232 x2) were 20/20 OK in the same `local_plan = 1` run.

Related: ClickHouse#118130

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

groeneai commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - e148090

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Build (amd_fuzzers) / Build ClickHouse not from this PR: the clickhouse_fuzzer link fails with relocation R_X86_64_PC32 out of range; the same job is red on master and on 166 PRs in the last 24h #123738 (external, merged 2026-10-04 01:14Z). This workflow was dispatched at 23:03Z, before that merge, so the fix is not in the tree that ran; a master merge to pick it up follows
Mergeable Check, PR rollups, red only because of the rows above #123738

This PR changes only six TimeSeries test files, and none of them failed anywhere it ran. All 157 checks completed and CH Inc sync passed; CIDB has no other FAIL or ERROR on this head.

Session id: cron:our-pr-ci-monitor:20261004-013156

@alexey-milovidov alexey-milovidov self-assigned this Oct 4, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 4, 2026
Merged via the queue into ClickHouse:master with commit 38be866 Oct 4, 2026
149 checks passed
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 4, 2026
aschoube added a commit to aschoube/ClickHouse that referenced this pull request Oct 8, 2026
Merge upstream commit 756552d,
including the `no-parallel-replicas` exclusion for
`05218_timeseries_alp_codec`. Preserve the existing read-in-order fix
and its regression test unchanged.

Related: ClickHouse#123677
Related: ClickHouse#123763
CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=123677&sha=20d3846994236af48dd6c0d7de94c83ba66be82a&name_0=PR

Co-authored-by: Copilot <[email protected]>
@clickhouse-gh clickhouse-gh Bot added comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... and removed comp-testing Test content only (no production code). labels Nov 22, 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 comp-promql PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter... groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding 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.

3 participants