Repository navigation
Backport #119853 to 26.6: Fix a server crash on a NATS table whose credentials the broker rejects - #120013
Merged
Conversation
…credentials the broker rejects
Contributor
|
Workflow [BackportPR], commit [941bc33] Summary: ✅ |
On `master` the streaming cycle subscribes the consumers it finds unsubscribed before it reads from them. 26.6 has no such step: `initializeConsumersFunc` subscribes the consumers once, right after creating them, and `NATSSource` subscribes a consumer it finds unsubscribed only for the duration of its own cycle, unsubscribing it on destruction. A cycle over a consumer which has nothing buffered yet ends at once, so the consumers rebuilt by the backported recovery path held a subscription for a fraction of a millisecond every 500 ms and never received a message: the broker log of the failed CI run shows `subscribed sid N` / `unsubscribed sid N` pairs after the credentials are accepted again, and the table stayed idle. Subscribe the rebuilt consumers right after creating them, the way `initializeConsumersFunc` does for the first ones. CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=120013&sha=2ce5c98f204faea061807a26a704af29a1490e3c&name_0=BackportPR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%204%2F6%29 PR: #120013 Co-Authored-By: Claude Fable 5.1 <[email protected]>
26.6 has neither `SYSTEM STOP <table>` for streaming engines nor the `nats_wait_for_flush_interval` setting, so drop the two tests of a stopped table recovering from a closed connection. Its JetStream consumer does not acknowledge messages after the insert into the views either, so drop the test of unacknowledged messages surviving the rotation; the remaining JetStream test, which drains the backlog exactly once through the rebuilt connection, passes on 26.6. The NATS integration tests were removed from 26.6, so restore the pieces the JetStream test needs: `__init__.py`, `nats_certs.sh` which `ClickHouseCluster` runs for `with_nats=True`, and a `common.py` with the two helpers the test uses. CI: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=120013&sha=2ce5c98f204faea061807a26a704af29a1490e3c&name_0=BackportPR&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%204%2F6%29 PR: #120013 Co-Authored-By: Claude Fable 5.1 <[email protected]>
Member
|
🕵 The integration reds were the backported tests exercising things 26.6 does not have, plus one genuine gap in the backported recovery path on 26.6. Pushed two commits:
Locally on 26.6 with the branch's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
26.6.7.15