Repository navigation
Antalya 26.6: Add an Antalya-only protocol version advertised in the ServerHello - #2378
Conversation
Antalya carries wire features that do not exist upstream and rebases onto every upstream release. An Antalya-only change that takes a slot in `DBMS_TCP_PROTOCOL_VERSION` or `DBMS_CLUSTER_PROCESSING_PROTOCOL_VERSION` is renumbered by the next rebase, so the same number comes to mean two different things in two shipped builds. `DBMS_ANTALYA_PROTOCOL_VERSION` is a counter in a number space upstream cannot reach, in its own header rather than in `ProtocolDefines.h`, whose tail is where every rebase conflicts. `TCPHandler::sendHello` appends " (antalya:N)" to the `ServerHello` name on every connection; `Connection::receiveHello` strips it and keeps `min(own, N)`. Version 1 is the advertisement itself, with no payload. The advertisement is one-directional by necessity. The client writes its `Hello` before reading anything from the peer, so it cannot gate a marker on what the peer is, and every field in that packet is one an upstream server acts on: `client_name` is persisted to `system.query_log` and compared against the Query packet's `ClientInfo` under `validate_tcp_client_information`, so a marker there would fail a `remote()` query against any peer that does not strip it with `CLIENT_INFO_DOES_NOT_MATCH`. `server_name` carries no such role - it is client-side display text that reaches no system table - which is why the server is the side that speaks. A feature that needs the server to learn the client's version will need a new Antalya-only client packet type sent after the Addendum, gated on the negotiated version. The Addendum cannot carry it: `TCPHandler::receiveAddendum` reads a fixed field list and cannot tell a client that wrote an extra field from one that did not, so it would read bytes that are not there. See `docs/en/antalya/protocol.md`. The only effect on an upstream peer is cosmetic: a client that does not strip the marker displays `ClickHouse (antalya:1)` as the server name. Covered by `gtest_antalya_protocol` for the marker grammar, `05054` for the advertisement being independent of the client name, `05053` for no Antalya string reaching `system.query_log`, and `test_antalya_protocol`, which exercises both directions against a build that predates the marker.
`docs/en/interfaces/specs/NativeProtocol.md` is the canonical description of the native protocol and the file a third-party client is built against, so the `ServerHello` `server_name` row now says that an Antalya build appends " (antalya:N)" and that the suffix may be ignored or stripped. That row is the whole delta against a file which tracks upstream through every rebase; the counter itself stays documented in `docs/en/antalya/protocol.md`, which also records when a future Antalya wire change must grow that delta - when it changes the layout of a packet the spec describes field by field, because a client that does not know about an added field cannot parse the stream past it. The same doc records why the advertisement has no opt-out. `server_name` is a build-time value any fork may set, so a client cannot treat it as fixed; `client_name` is the field that reaches `system.query_log` and `validate_tcp_client_information`, and it is never marked. A per-node switch would only add a state in which two Antalya nodes that both support a feature fail to negotiate it because one was configured not to advertise.
…ature/antalya-26.6/antalya-protocol-version
Keep only the comments that carry something the code does not: the bump rule for `DBMS_ANTALYA_PROTOCOL_VERSION`, the marker grammar, the bounded parse in `parseMarker`, and the sanitization ordering the client depends on. The rest repeated the code or `docs/en/antalya/protocol.md`. Drop the tests whose coverage is pinned elsewhere: - `05054_antalya_protocol_server_hello.py` hand-rolled a native client to read the `ServerHello` name, which `gtest_antalya_protocol.cpp` pins at the unit level and the integration test proves over a real connection. - `test_interserver_secret_negotiates`: `TCPHandler::sendHello` has no branches, so no kind of connection can skip the marker. - `test_remote_table_function_sends_a_matching_client_info` and `test_client_name_in_query_log_is_untouched` duplicated `05053_antalya_protocol_marker.sql`, which runs with `validate_tcp_client_information` enabled by `tests/config/install.sh`. - `test_distributed_cluster_negotiates` asserted the same log line through the same code as `test_remote_function_negotiates`. The integration module needs no server config now, so `configs/` goes with them.
The same facts were stated up to three times: that the client `Hello` is never marked, that only the server advertises, that the client caps with `min(own, server)`. State each once, lead with the wire form, and turn the rules for a future wire change into a checklist. Drop the `Scope` section, whose only unique sentence - negotiation is per hop - moved into the intro, and the paragraph describing a client-to-server channel that does not exist yet.
Keep only the production API used by `Connection`, remove the test-only client-name refactor, and reduce unit and integration coverage to distinct protocol behaviors. Related: #2378
ianton-ru
left a comment
There was a problem hiding this comment.
LGTM, except topic to discussion in comment.
Upstream clients display `ServerHello` name with the marker anyway, so Antalya clients now only parse it with `parseMarker` instead of stripping it. #2378 (comment)
…b.com:Altinity/ClickHouse into feature/antalya-26.6/antalya-protocol-version
CI triage — #2378 (Antalya protocol version)Verdict: 0 failures caused by this PR. All red checks are one of: base-image CVE scan (infra), a pre-existing regression-suite maintenance gap, or a known-flaky test that reran green in the same job. Nothing in the failing set touches Head SHA analyzed: Per-failure breakdown1–4. Grype Scan (keeper + server-alpine) — infra, not PR-related
This scans the built Docker images for OS/library CVEs; it is independent of C++ source. The same single CVE is flagged on both images and will hit every PR built from the current base images until they're rebased/patched. This PR adds no dependencies. → Safe to ignore for this PR. Needs a base-image bump handled separately. 5–6. RegressionTestsRelease / Common (settings) / settings — pre-existing suite maintenance
This is the testflows "default values" suite asserting each server setting matches a recorded expected default. 7. Stateless (amd_asan_ubsan, cas s3 storage, parallel, 1/2) — flaky, reran green
A transient CAS-on-S3 lease/network timeout in a teardown-race stress test — unrelated to protocol negotiation. → Safe to re-run. 8. Stateless (amd_asan_ubsan, distributed plan, parallel, 2/2) — flaky, reran green
An export-completion timeout under load; nothing to do with (The top-level PR health checkThe change is tightly scoped and low-risk: a new
Bottom line: no code changes needed for the red checks. Re-run the two flaky stateless suites; the Grype and regression-settings failures are environmental/pre-existing and out of this PR's scope. |
…next commit) --- Original cherry-pick message follows: Merge pull request #2378 from Altinity/feature/antalya-26.6/antalya-protocol-version Antalya 26.6: Add an Antalya-only protocol version advertised in the `ServerHello` # Conflicts: # src/Server/TCPHandler.cpp
Kept both `Core/Block.h` (present on antalya-26.8) and `Core/AntalyaProtocol.h` (added by the source PR) includes in `src/Server/TCPHandler.cpp`.
Adds an Antalya-only protocol version without consuming an upstream protocol-version slot. The server advertises it as a suffix in the
ServerHelloname; Antalya clients strip the suffix and cap the advertised value to their own supported version. Older clients and servers remain compatible.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add an Antalya-only protocol version advertised in the
ServerHello.Documentation entry for user-facing changes
CI/CD Options
Exclude tests:
Regression jobs to run: