Skip to content

Fix flaky test 04103_user_network_bandwidth_throttler with parallel replicas - #123734

Merged
fm4v merged 2 commits into
ClickHouse:masterfrom
groeneai:fix-04103-throttler-parallel-replicas
Oct 4, 2026
Merged

fm4v merged 2 commits into
ClickHouse:masterfrom
groeneai:fix-04103-throttler-parallel-replicas

Conversation

@groeneai

@groeneai groeneai commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #122853

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

The test fails only in Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) (4 of 106 runs in 7 days, 4 unrelated PRs; 0 failures in every other lane), always as read 0 0 0, e.g. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119250&sha=bf2178c46c336e8c0cac2a5ec72cf613a6bf521e&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29

The read row checks that the initial query of a user with max_network_bandwidth_for_user = 200000 was throttled. With parallel replicas the table's only segment can be read by a remote replica, which runs as the cluster's user (default), so the read goes through that user's throttler, not this one (1.6 MB in ~14 ms in the job's query_log). Remote ProfileEvents are also not added to the initial query's row. By design a per-user limit applies to the user that runs the query on each server, so the assertion is not defined under parallel replicas.

Change: tag the test no-parallel-replicas, the convention already used for other tests that assert on ProfileEvents of the initial query in this lane (02770_async_buffer_ignore). The assertions are unchanged.

Validation, on a local server with the lane's config and parallel_replicas_local_plan = 0: without the tag the test failed in 19 of 25 runs, every time a non-local replica read the segment; with the tag it is skipped under --no-parallel-replicas and passes 5/5 without it, because the tag pins enable_parallel_replicas = 0. 20/20 on a plain s3 server.

🤖 Generated with Claude Code


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

Version info

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

…eplicas

In the `arm_binary, ParallelReplicas, s3 storage` lane the table's only
segment can be read by a remote replica. That replica runs as the cluster's
user (`default`), so the read bypasses this user's throttler, and its
ProfileEvents are not added to the initial query's `query_log` row, so the
`read` row is `0 0 0`. Tag the test `no-parallel-replicas`.

https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119250&sha=bf2178c46c336e8c0cac2a5ec72cf613a6bf521e&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29

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 (click to expand): 0 blockers, 0 majors, 1 nit
Finding Verdict
💡 PR description over-generalized the reason ("per server"); in CI the replicas are one server and the cause is the other user plus remote ProfileEvents not reaching the initial row AGREE, description reworded

Gate B (independent model): no findings.

Also noticed: the parallel replicas path forwards max_network_bandwidth_for_user to replicas that run as another user; not observed to change any result, not raised.

@clickhouse-gh

clickhouse-gh Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [60502fd]

Summary: ✅


AI Review

Summary

This PR marks tests/queries/0_stateless/04103_user_network_bandwidth_throttler.sh as incompatible with parallel replicas. That matches the test's actual contract: its read assertions inspect the initiator's system.query_log ProfileEvents, while under parallel replicas the decisive S3 read can run on a remote worker as the cluster user, so those counters are not guaranteed to appear in the initiator row. The change is small, consistent with other initiator-query_log tests that opt out of parallel replicas, and I did not find a correctness or PR-metadata issue in the final diff.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Oct 3, 2026
@groeneai
groeneai requested a review from fm4v October 3, 2026 17:55
@fm4v
fm4v enabled auto-merge October 3, 2026 18:00
@clickhouse-gh clickhouse-gh Bot added the comp-testing Test content only (no production code). label Oct 3, 2026
@groeneai

groeneai commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - e942902

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 diff is one test file): the clickhouse_fuzzer link fails with relocation R_X86_64_PC32 out of range against .bss; the same job is red on master and on 127 PRs in the last 24h #123738 (external, open)
Mergeable Check, PR rollups, red only because of the row above #123738 (external, open)

All 160 checks completed; CIDB has no other FAIL or ERROR on this head.

Session id: cron:our-pr-ci-monitor:20261003-210720

@alexey-milovidov alexey-milovidov added the blocker This issue / pr blocks a new release label Oct 4, 2026
@fm4v
fm4v added this pull request to the merge queue Oct 4, 2026
Merged via the queue into ClickHouse:master with commit 7f568d6 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
@clickhouse-gh clickhouse-gh Bot added comp-io IO library: ReadBuffer / WriteBuffer and their implementations over files and memory, read and wr... 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

blocker This issue / pr blocks a new release can be tested Allows running workflows for external contributors comp-io IO library: ReadBuffer / WriteBuffer and their implementations over files and memory, read and wr... 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.

4 participants