Skip to content

Ignore benign PostgreSQL background-reconnection errors in the upgrade check - #108998

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-upgrade-check-postgresql-bg-reconnect
Jul 1, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-upgrade-check-postgresql-bg-reconnect

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Jun 30, 2026 •

Copy link
Copy Markdown
Member

Related: #108939

What & why

The upgrade check (tests/docker_scripts/upgrade_runner.sh) scans the post-upgrade server log for <Error> lines and fails on anything not in its allow-list. It intermittently fails with:

<Error> PostgreSQLConnectionPool: Connection error: connection to server at "192.0.2.1", port 5432 failed: timeout expired
<Error> void DB::DatabasePostgreSQL::removeOutdatedTables(): Code: 614. DB::Exception: Try 2. Connection to `192.0.2.1:5432` failed ...

These come from a leftover DatabasePostgreSQL engine created by 04210_show_remote_databases_in_system_tables, which points at the RFC 5737 documentation IP 192.0.2.1 (intentionally unreachable). The stress phase runs the stateless tests under a global time limit and can interrupt that test between its CREATE DATABASE ... ENGINE = PostgreSQL('192.0.2.1:5432', ...) and the final DROP DATABASE, leaving the database in metadata. After the upgrade restart, DatabasePostgreSQL::startup unconditionally activates the PostgreSQLCleanerTask, whose removeOutdatedTables tries to connect and the connection pool logs <Error> for each retry.

This Error message in clickhouse-server.log subcheck has tripped on ~89 distinct PRs in the last 7 days; it is environmental, not a compatibility regression.

Fix

This is the same class of benign background-reconnection-after-restart noise already allow-listed for Kafka (rdk:FAIL / StorageKafka2), Azure DNS, and NuRaft. Two regex filters are added to the secondary pipe, each requiring the PostgreSQL connection-pool / cleaner-task context together with the connection-failure symptom, so real PostgreSQL regressions (auth, protocol, query errors) are not masked:

| grep -av -e "PostgreSQLConnectionPool: Connection error" \
| grep -av -e "DatabasePostgreSQL::removeOutdatedTables.*Connection to .* failed" \

Verified locally that both benign lines are suppressed while a real PostgreSQL auth/query error and an unrelated DatabasePostgreSQL error still surface.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108939&sha=27734f50667a6b77ca59b768e605b4d843acde3c&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29

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 for changelog.

Documentation entry for user-facing changes

Not applicable — CI test infrastructure only.

Version info

  • Merged into: 26.7.1.317 (included in 26.7 and later)

…e check

The upgrade check (`tests/docker_scripts/upgrade_runner.sh`) scans the
post-upgrade server log for `<Error>` lines and fails on anything not in its
allow-list. It intermittently fails with:

    <Error> PostgreSQLConnectionPool: Connection error: connection to server at "192.0.2.1", port 5432 failed: timeout expired
    <Error> void DB::DatabasePostgreSQL::removeOutdatedTables(): Code: 614. DB::Exception: Try 2. Connection to `192.0.2.1:5432` failed ...

These come from a leftover `DatabasePostgreSQL` engine created by
`04210_show_remote_databases_in_system_tables`, which points at the RFC 5737
documentation IP `192.0.2.1` (intentionally unreachable). The stress phase runs
the stateless tests under a global time limit and can interrupt that test
between its `CREATE DATABASE ... ENGINE = PostgreSQL('192.0.2.1:5432', ...)` and
the final `DROP DATABASE`, leaving the database in metadata. After the upgrade
restart, `DatabasePostgreSQL::startup` unconditionally activates the
`PostgreSQLCleanerTask`, whose `removeOutdatedTables` tries to connect and the
connection pool logs `<Error>` for each retry.

This is the same class of benign background-reconnection-after-restart noise
already allow-listed for Kafka (`rdk:FAIL`/`StorageKafka2`), Azure DNS, and
NuRaft. Add two regex filters in the secondary pipe that require the PostgreSQL
connection-pool / cleaner-task context together with the connection-failure
symptom, so real PostgreSQL regressions (auth, protocol, query errors) are not
masked.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=108939&sha=27734f50667a6b77ca59b768e605b4d843acde3c&name_0=PR&name_1=Upgrade%20check%20%28amd_release%29
Related: #108939

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [8b3cf74]

Summary: ✅


AI Review

Summary

This PR adds upgrade-log allow-list entries for benign PostgreSQL background reconnection errors left by 04210_show_remote_databases_in_system_tables. The intent is sound, but the current regexes are broader than the described contract and can hide real PostgreSQL connection failures. I posted one inline finding; the verdict is request changes until the filters are narrowed.

Findings

⚠️ Majors

  • [tests/docker_scripts/upgrade_runner.sh:500-501] The new PostgreSQL filters violate the upgrade check contract of surfacing real post-upgrade <Error> lines: PostgreSQLConnectionPool: Connection error is logged for every pqxx::broken_connection, and DatabasePostgreSQL::removeOutdatedTables.*Connection to .* failed drops the wrapper for any failed database-engine connection. This can mask real upgraded-server PostgreSQL regressions such as bad credentials, DNS/TLS failures, or other connection failures. Narrow both regexes to the known 04210_show_remote_databases_in_system_tables leftover, e.g. require 192\.0\.2\.1, 5432, and the timeout/unreachable symptom or another unique marker.
Final Verdict

Status: ⚠️ Request changes

Minimum required action: narrow the two PostgreSQL allow-list regexes so they only suppress the known intentionally unreachable 192.0.2.1:5432 background-cleaner noise.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 30, 2026
Comment thread tests/docker_scripts/upgrade_runner.sh Resolved
@alexey-milovidov alexey-milovidov self-assigned this Jul 1, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jul 1, 2026
Merged via the queue into master with commit baf683c Jul 1, 2026
174 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-upgrade-check-postgresql-bg-reconnect branch July 1, 2026 03:01
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 1, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
…k-postgresql-bg-reconnect

Ignore benign PostgreSQL background-reconnection errors in the upgrade check
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.

2 participants