Skip to content

Run 04869_postgresql_tls_trailing_arguments sequentially - #114818

Merged
PedroTadim merged 2 commits into
ClickHouse:masterfrom
groeneai:ci-04869-postgresql-tls-no-parallel
Aug 14, 2026
Merged

PedroTadim merged 2 commits into
ClickHouse:masterfrom
groeneai:ci-04869-postgresql-tls-no-parallel

Conversation

@groeneai

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

Related: #114580

04869_postgresql_tls_trailing_arguments registers a PostgreSQL database pointing at the
unreachable 127.0.0.1:1 and ran in the parallel group. Since
show_remote_databases_in_system_tables defaults to true, that database is visible in
system.tables, system.columns and system.completions, so a concurrent query scanning
those tables without a database filter connects to the unreachable host. The connection
failure is logged on the scanning query's own thread, so it reaches that client's stderr, and
clickhouse-test fails any test whose stderr is non-empty. The polluter stays green and an
unrelated test goes red, which makes the failure unattributable from the victim's side.

One master hit since the test landed on 2026-08-13: 00938_fix_rwlock_segfault_long in
Stateless tests (arm_binary, parallel), whose whole body is an unfiltered system.tables and
system.columns scan.
CI report

I add no-parallel with a written justification, matching the sibling
04210_show_remote_databases_in_system_tables, which documents this exact hazard and carries
the tag for it. I checked the two alternatives first, and both are impossible rather than
merely unattractive: the visibility setting is read from the scanning query's context, so the
polluter cannot hide itself (verified: setting it to 0 on the scanner silences the log, setting
anything on the creator cannot), and a blackholed address only turns an instant refusal into a
connect timeout while still logging, which is why 04210 uses 192.0.2.1 and the tag. Test
statements and the reference file are unchanged; the test runs in 0.23 s, so serializing it
costs nothing.

The test registers a PostgreSQL database pointing at the unreachable 127.0.0.1:1
and ran in the parallel group. Because show_remote_databases_in_system_tables
defaults to true, that database is visible in system.tables, system.columns and
system.completions, so a concurrently running test that scans those tables
without a database filter tries to connect to the unreachable host. The
connection failure is logged on the scanning query's own thread, so it is
streamed to that client's stderr, and clickhouse-test fails any test whose
stderr is non-empty. The polluter stays green while an unrelated test goes red,
which makes the failure unattributable from the victim's side.

Observed once on master since the test landed: 00938_fix_rwlock_segfault_long in
Stateless tests (arm_binary, parallel), whose entire body is an unfiltered
system.tables and system.columns scan repeated 100 times.

Neither alternative to the tag is available. The visibility setting is read from
the scanning query's context, so the test cannot hide the object it creates; and
a blackholed address only converts an instant connection refusal into a connect
timeout while still logging, which is why the sibling test
04210_show_remote_databases_in_system_tables uses 192.0.2.1 and no-parallel. The
justification comment follows that test's style.

No test statement is changed and the reference file is unchanged.
The no-parallel tag added in the previous commit routes this test through
clickhouse-test's sequential group, which runs one test at a time in the parent
process after every parallel worker has joined, and sizes its repetitions from
--sequential-test-runs. The comment above the test body still said the flaky
check runs it many times in parallel, which was true before the tag and is false
after it.

Keep the reason the database name comes from a macro, since concurrent
independent clickhouse-test invocations still share one server, and drop the
claim about parallel repetitions.
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review

Two rounds. Round 1 raised one issue and it was fixed before this PR was opened; round 2 is clean.

# Issue Verdict
❌ The tag made the file's own comment false: it claimed "the flaky check runs this test many times in parallel", but no-parallel routes the test to the sequential runner (clickhouse-test:4436-4448, :5491, and get_runs sizing repeats from --sequential-test-runs). Fixed in a69316d1. Replaced with the reason that survives the tag: the macro exists so concurrent independent clickhouse-test invocations against one server do not collide, which no-parallel does not address.
⚠️ The tag must actually parse, or the fix is a silent no-op (test green, defect persists, no error). Re-asserted on the final tree against both parsers: clickhouse-test's and find_tests.Targeting.is_sequential_functional_test (CI batch selection). Both report sequential, with 04210 as a positive and 00938 as a negative control, plus two mutations that correctly break the parse.
⚠️ Completeness: is any other stateless test an untagged carrier? Census re-run independently over all stateless tests, plus a wider sweep. 11 candidates: 6 already tagged, 4 non-carriers (their CREATE is asserted to throw, or the DDL is only ever parsed as text), and this one. No sibling fix-ups needed.
💡 Moving the test parallel -> sequential swaps two unpaired job flavors. A swap, not a loss, and inherent to the mechanism for all six already-tagged siblings.

@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate
# Check Result
a Deterministic repro Yes. An unfiltered system.tables/system.columns scan while the database is registered produces the stderr 100% of the time, both single-process (clickhouse local) and cross-session against a server. Not a rare race.
b Root cause explained Yes. show_remote_databases_in_system_tables defaults to true, so a bystander's unfiltered scan iterates the unreachable PostgreSQL database; the connection failure is logged on the scanning query's own thread and reaches that client's stderr, which clickhouse-test treats as a failure.
c Fix matches root cause Yes. The polluter cannot hide the object (the visibility setting is read from the scanner's context), so removing the concurrency is the only available lever. Not a widened bound or a silenced assertion.
d Test intent preserved Yes. No statement changed and the reference file is byte-identical; the positive CREATE DATABASE assertion added by #114580 is untouched.
e Both directions demonstrated Yes. Same command, same binary: pre-fix Found 1 parallel tests and 0 sequential tests, post-fix Found 0 parallel tests and 1 sequential tests. Victim side: 0 bytes of stderr with no database registered, 371540 bytes with it registered.
f General across code paths Yes. Mechanical census of every stateless test that creates a remote database engine: 11 candidates, 6 already tagged, 4 measured as non-carriers (their CREATE is asserted to throw, or the DDL is never executed). This test was the only untagged carrier.
g Generalizes across inputs N/A for a tag change. Verified all three tags still parse, so no-fasttest remains honoured; the justification names all three affected system tables.
h Backward compatible Yes. Test-only. No setting default, no serialization format, no SettingsChangesHistory.cpp entry.
i Invariants preserved Yes. Test semantics unchanged; the only effect is scheduling. The test runs in 0.23 s, so serializing it is negligible.

Stability: 10 consecutive post-fix runs, 10/10 OK, all in the sequential group.

@clickhouse-gh

clickhouse-gh Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a69316d]

Summary: ✅


AI Review

Summary

This PR moves 04869_postgresql_tls_trailing_arguments out of the parallel stateless pool by adding the no-parallel tag and documenting the cross-test pollution it causes when an unreachable PostgreSQL database becomes visible through system.tables, system.columns, and system.completions. I verified that both the CI batch selector and clickhouse-test treat this file as sequential from the Tags: line, and that sequential tests run after the parallel pool rather than alongside it, so the scheduling change matches the stated failure mode. No correctness, coverage, or PR-metadata issues stood out in the current diff.

Final Verdict

✅ Approved. No inline findings to post.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 14, 2026
@PedroTadim PedroTadim self-assigned this Aug 14, 2026
@PedroTadim PedroTadim added the can be tested Allows running workflows for external contributors label Aug 14, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @GrigoryPervakov, could you review this? The test registers a PostgreSQL database at an unreachable host and ran in the parallel group, so a concurrent unfiltered system.tables scan connected to it and the connection error reached that other test's stderr, failing it. I tag it no-parallel with a justification, matching the sibling 04210_show_remote_databases_in_system_tables.

@clickhouse-gh

clickhouse-gh Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing a69316d13 with master 7ac9a3b20 (stripped binary size, per-symbol sizes and ThinLTO time; object sizes against the warmup build of 2dba8ed9d; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 692.70 MiB 689.68 MiB -3.02 MiB (-0.44%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Object file sizes

3 object files changed (+26.80 KiB total), 0 added.

Object file Master PR Δ
src/CMakeFiles/dbms.dir/Storages/ObjectStorage/DataLakes/Paimon/BinaryRow.cpp.o 127.31 KiB 143.98 KiB +16.67 KiB (+13.09%)

737 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only clickhouse-bundle) and not compared.

Compile time of recompiled translation units

31 translation units recompiled, 381 s compile time in total, 31 of them have a recent master baseline.

Job report

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - a69316d

CI finished with no failing checks on this commit (praktika top-level status OK,
177 leaves, 0 dropped jobs).

Check / test Reason Owner / fixing PR
- no failures -
Sync - CH Inc sync (private, not actionable)

Session id: cron:our-pr-ci-monitor:20260814-180000

@PedroTadim
PedroTadim added this pull request to the merge queue Aug 14, 2026
Merged via the queue into ClickHouse:master with commit 4163b18 Aug 14, 2026
356 of 358 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 Aug 14, 2026
@groeneai groeneai added the groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding label Aug 19, 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 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