Skip to content

tests: fix 01563_distributed_query_finish flakiness from CI log-sender bursts - #105457

Merged
Algunenano merged 1 commit into
masterfrom
fix-01563-stop-distributed-sends
May 22, 2026
Merged

Algunenano merged 1 commit into
masterfrom
fix-01563-stop-distributed-sends

Conversation

@Algunenano

@Algunenano Algunenano commented May 20, 2026 •

Copy link
Copy Markdown
Member

The test compares the global system.errors NETWORK_ERROR counter
before and after each iteration of a Distributed SELECT loop, and
expects at least one iteration with delta 0. The CI environment installs
system.*_log_sender Distributed tables (via
ci/jobs/scripts/functional_tests/setup_log_cluster.sh) that ship system
logs to a remote ClickHouse endpoint. When that endpoint is unreachable
(today: ~70% connection-reset rate on
kng4alm55c.us-east-2.aws.clickhouse-staging.com:9440, peak ~4 errors/s),
every iteration overlaps with at least one new background NETWORK_ERROR
and the test fails with NETWORK_ERROR=N. All 6 failures today share
this pattern across 5 unrelated PRs and release/26.2, clustered in a
single hour — clearly infrastructure, not a code regression.

Wrap the loop in SYSTEM STOP/START DISTRIBUTED SENDS so the background
async-insert sender stops shipping queued .bin files for the duration
of the test. The ActionLocks::DistributedSend lock only gates
async_insert_blocker in StorageDistributed::getActionLock, which is
consulted exclusively by DistributedAsyncInsertDirectoryQueue — so the
test's own SELECT FROM dist_01247 is unaffected.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=105053&sha=af01ec85282c49af3fed289c244018319a061ba3&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20sequential%2C%202%2F2%29

Closes #105452

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 to CHANGELOG.md):

Fix flakiness of 01563_distributed_query_finish when the CI log-shipping endpoint is unreachable.

Version info

  • Merged into: 26.6.1.95

The test compares the global system.errors NETWORK_ERROR counter before and
after each iteration and expects at least one iteration with delta 0. When
the CI system.*_log_sender background pool generates a burst of connection
errors against its remote destination, every iteration overlaps with at
least one new error and the test fails with NETWORK_ERROR=N.

Wrap the loop in SYSTEM STOP/START DISTRIBUTED SENDS so the async insert
sender stops shipping queued .bin files for the duration of the test.
SELECT from dist_01247 is unaffected because ActionLocks::DistributedSend
only gates async_insert_blocker, not the SELECT path.
@clickhouse-gh

clickhouse-gh Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [ba942ea]

Summary: ❌

job_name test_name status info comment
Finish Workflow FAIL
python3 ./ci/jobs/scripts/workflow_hooks/check_report_messages.py FAIL IGNORED

AI Review

Summary

This PR updates tests/queries/0_stateless/01563_distributed_query_finish.sh to pause Distributed background sends during the assertion loop so CI log-shipping failures do not pollute system.errors NETWORK_ERROR counters and make the test flaky. The change is narrowly scoped to the test logic, the lock behavior matches how SYSTEM STOP DISTRIBUTED SENDS is implemented for StorageDistributed, and I did not find a correctness or safety regression in the current diff.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 20, 2026
@Algunenano
Algunenano enabled auto-merge May 22, 2026 14:30
@Algunenano
Algunenano added this pull request to the merge queue May 22, 2026
Merged via the queue into master with commit 4ad681d May 22, 2026
647 of 652 checks passed
@Algunenano
Algunenano deleted the fix-01563-stop-distributed-sends branch May 22, 2026 14:45
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label May 22, 2026
DavidHe-2008 pushed a commit to DavidHe-2008/ClickHouse that referenced this pull request Jun 1, 2026
…istributed-sends

tests: fix 01563_distributed_query_finish flakiness from CI log-sender bursts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Flaky test: 01563_distributed_query_finish

2 participants