Skip to content

CI: set up Kafka in upgrade tests - #106563

Merged
alexey-milovidov merged 1 commit into
masterfrom
fix-upgrade-check-kafka-broker
Jun 5, 2026
Merged

alexey-milovidov merged 1 commit into
masterfrom
fix-upgrade-check-kafka-broker

Conversation

@mstetsyuk

@mstetsyuk mstetsyuk commented Jun 5, 2026 •

Copy link
Copy Markdown
Member

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

...

Version info

  • Merged into: 26.6.1.428

@clickhouse-gh

clickhouse-gh Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [1e134b2]

Summary: ✅


AI Review

Summary

This PR starts Redpanda through setup_kafka.sh in upgrade_runner.sh so Kafka stateless tests can run during upgrade checks. The startup placement matches the CI image capabilities, but the script still keeps the old no-broker Kafka log suppression, so the check can continue masking the failures this change is meant to expose.

Missing context / blind spots
  • ⚠️ The Praktika report for 1e134b2d79fed86ae2a7cf581e2aa5ad54f60cb7 showed Upgrade check (amd_release) as PENDING; a passing run would close the end-to-end evidence gap.
Findings
  • ⚠️ Majors
    • [tests/docker_scripts/upgrade_runner.sh:25] The PR promises Kafka-backed upgrade tests by starting setup_kafka.sh, but the later server-log scan still unconditionally filters "[rdk:FAIL]", "[rdk:ERROR]", and Exception during get topic partitions from Kafka: Local: Broker transport failure, with nearby comments describing a missing broker. Once Redpanda is expected to be healthy, those messages can be real Kafka upgrade regressions and will be removed before check_status.tsv is computed.
    • Suggested fix: remove the broad rdk filters, or replace them with narrowly matched patterns that are still proven to occur with a healthy broker during controlled startup/shutdown.
Tests
  • ⚠️ Please provide a passing Upgrade check (amd_release) run for this commit, or a direct run of upgrade_runner.sh, so the new broker setup and tightened log filter are exercised end to end.
Final Verdict

Status: ⚠️ Request changes

Minimum required actions: narrow or remove the stale Kafka log filters and rerun the upgrade check successfully.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Jun 5, 2026
cd /repo && python3 /repo/ci/jobs/scripts/clickhouse_proc.py start_azurite || { echo "Failed to start azurite"; exit 1; }
cd /repo && python3 /repo/ci/jobs/scripts/clickhouse_proc.py start_minio stateless || ( echo "Failed to start minio" && exit 1 ) # to have a proper environment

bash /repo/ci/jobs/scripts/functional_tests/setup_kafka.sh || { echo "Failed to start Kafka (Redpanda)"; exit 1; }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting setup_kafka.sh makes the upgrade check's Kafka contract stronger, but the error scan below still blanket-filters "[rdk:FAIL]", "[rdk:ERROR]", and Exception during get topic partitions from Kafka: Local: Broker transport failure as if no broker were running. With Redpanda available, those log lines can now be real Kafka upgrade regressions and would still be removed before the log check decides whether the upgrade passed. Please remove the broad filters, or replace them with exact expected shutdown/startup patterns observed with a healthy broker.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, we can do it in the next step.

@alexey-milovidov alexey-milovidov self-assigned this Jun 5, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Jun 5, 2026
Merged via the queue into master with commit 8e4b45d Jun 5, 2026
166 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-upgrade-check-kafka-broker branch June 5, 2026 16:23
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jun 5, 2026
pull Bot pushed a commit to Spencerx/ClickHouse that referenced this pull request Jun 6, 2026
…utdown noise

The upgrade-check post-restart `<Error>` scrub catches a transient lock-timeout
emitted by `SystemLog<MetricLogElement>::flushImpl` when the background `MetricLog`
flush loop races with shutdown work on `system.metric_log` during the upgrade restart
sequence:

```
<Error> void DB::SystemLog<DB::MetricLogElement>::flushImpl(...) [LogElement = DB::MetricLogElement]: Failed to flush system log system.metric_log with N entries up to offset M: Code: 473. DB::Exception: WRITE locking attempt on "system.metric_log" has timed out! (60000ms) Possible deadlock avoided. Client should retry. Owner query ids: . (DEADLOCK_AVOIDED), Stack trace ...
```

Another worker (DROP/RENAME/DETACH on `system.metric_log`, or a parallel
mutation/merge) holds the table-level write lock, the flush blocks for the
60s timeout, and then aborts with code 473 (`DEADLOCK_AVOIDED`). The 473 code is
the engine's own "gave up to avoid a deadlock, not a crash" signal — losing a few
`MetricLogElement` samples during shutdown is harmless; the upgrade-check stage is
not asserting on metric continuity.

CIDB confirms this is chronic CI noise, not a code regression: 4 hits across 4
distinct PRs in the last 30 days, 0 master, 100% on `Upgrade check (amd_release)`.
Reported by @ alexey-milovidov on PR ClickHouse#102017 (cited ClickHouse#106425, ClickHouse#104561, ClickHouse#106202).

The added regex requires BOTH the `SystemLog` flush wrapper for `metric_log` AND
the `DEADLOCK_AVOIDED` error code together, mirroring the narrowing approach of
the existing `rdk:FAIL.*Connect to.*failed: Connection refused` and
`StorageKafka2.*Broker transport failure` filters. Real `metric_log` regressions
(other flush errors) and unrelated `DEADLOCK_AVOIDED` hits on other system_log
tables (`query_log`, `text_log`, etc.) still surface.

Related: ClickHouse#102017
Related: ClickHouse#106563
Related: ClickHouse#101576

Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.

3 participants