Skip to content

Backport #119853 to 26.3: Fix a server crash on a NATS table whose credentials the broker rejects - #120012

Merged
PedroTadim merged 2 commits into
26.3from
backport/26.3/119853
Sep 15, 2026
Merged

PedroTadim merged 2 commits into
26.3from
backport/26.3/119853

Conversation

@robot-clickhouse-ci-2

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #119853

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.33.85

@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Sep 14, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [9197fad]

Summary: ✅

The backport built and the JetStream half of the recovery passed, but the
core `NATS` half consumed nothing after the table replaced the connection
the client library had closed: on 26.3 only `initializeConsumersFunc`
subscribes, once, on the way to the first streaming cycle, so the consumers
created for the new connection stayed unsubscribed and every cycle
subscribed through `NATSSource` and unsubscribed at its end, a window too
short for the broker to deliver anything. Master subscribes in the
streaming loop whenever the consumers are not ready; do the same here.

The tests were written for master's `test_storage_nats`, which 26.3 does
not have (it was removed in c250fb0 and brought back on master in
499e3a1), so bring the package files they import from master:
`__init__.py`, `common.py` and `nats_certs.sh` (the cluster helper runs the
latter for `with_nats=True`).

Drop the tests of behaviour 26.3 does not have: `SYSTEM STOP`/`START`/
`REFRESH` on a `NATS` table (a syntax error on 26.3) and the JetStream
manual-acknowledgement test (`ManualAck` is not set on 26.3, the messages
are acknowledged on delivery). The remaining two tests cover the crash and
the recovery for core `NATS` and JetStream and pass locally.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=120012&sha=059eccc057ab6c3644d6653e438e02f20bc8c5e4&name_0=BackportPR&name_1=Integration%20tests%20%28amd_asan%2C%20db%20disk%2C%20old%20analyzer%2C%205%2F6%29
PR: #120012

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Adapted the backport to 26.3 in 9197fad, after the three integration failures of the first run:

  • test_nats_credentials_rejected_after_rotation consumed nothing after the table replaced the closed connection: on 26.3 only initializeConsumersFunc subscribes, once, so the consumers created for the new connection stayed unsubscribed and every cycle subscribed through NATSSource and unsubscribed at its end (visible in the ASan server log as a subscribe/unsubscribe pair every 500 ms). Master subscribes in the streaming loop whenever the consumers are not ready; the backport now does the same.
  • ImportError in the JetStream module: 26.3 has no test_storage_nats package (removed in c250fb0, brought back on master in 499e3a1). Brought __init__.py, common.py and nats_certs.sh from master.
  • The two SYSTEM STOP/START/REFRESH tests are a syntax error on 26.3, which has no such statements for a NATS table, and the JetStream manual-acknowledgement test relies on ManualAck, which 26.3 does not set. Both test features 26.3 does not have, so they are dropped from the backport. The remaining two tests (core NATS against the fake broker, JetStream against the authentication proxy) pass locally with a 26.3 build.

@PedroTadim
PedroTadim merged commit b9c10f8 into 26.3 Sep 15, 2026
34 checks passed
@PedroTadim
PedroTadim deleted the backport/26.3/119853 branch September 15, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants