Skip to content

Antalya 26.6: Add an Antalya-only protocol version advertised in the ServerHello - #2378

Merged
zvonand merged 12 commits into
antalya-26.6from
feature/antalya-26.6/antalya-protocol-version
Sep 29, 2026
Merged

zvonand merged 12 commits into
antalya-26.6from
feature/antalya-26.6/antalya-protocol-version

Conversation

@zvonand

@zvonand zvonand commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Adds an Antalya-only protocol version without consuming an upstream protocol-version slot. The server advertises it as a suffix in the ServerHello name; 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):

  • Improvement

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

  • Documentation is included in this pull request.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASan
  • All with TSan
  • All with MSan
  • All with UBSan
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

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.
@zvonand zvonand added port-antalya PRs to be ported to all new Antalya releases antalya-26.6 labels Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Workflow [PR], commit [80e14e8]

@zvonand
zvonand marked this pull request as draft September 16, 2026 13:01
`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.
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
@zvonand
zvonand marked this pull request as ready for review September 25, 2026 12:33
@zvonand
zvonand requested a review from ianton-ru September 28, 2026 08:57
ianton-ru
ianton-ru previously approved these changes Sep 28, 2026

@ianton-ru ianton-ru left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, except topic to discussion in comment.

Comment thread src/Core/AntalyaProtocol.cpp Resolved
Upstream clients display `ServerHello` name with the marker anyway, so
Antalya clients now only parse it with `parseMarker` instead of stripping it.

#2378 (comment)
@zvonand

zvonand commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

@blau-ai

@blau-ai

blau-ai commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

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 ServerHello, Connection, TCPHandler, or AntalyaProtocol. Notably, the two stateless suites that did run your .expect changes (02116_interactive_hello, 03272_client_highlighting_bug) passed — so the marker-tolerance updates work.

Head SHA analyzed: 80e14e8.

Per-failure breakdown

1–4. Grype Scan (keeper + server-alpine) — infra, not PR-related

Grype Scan Completed with 1 high/critical vulnerabilities → CVE-2026-85091

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

1714 scenarios (1709 ok, 1 failed, 4 xfail) — the one failure is:
/settings/default values/iceberg_manifest_min_count_to_compact → Fail

This is the testflows "default values" suite asserting each server setting matches a recorded expected default. iceberg_manifest_min_count_to_compact (default 30, src/Core/Settings.cpp:8369) is an Antalya Iceberg-compaction setting introduced on the antalya-26.6 base branch, and the external regression suite's reference list hasn't been updated for it. This PR adds/changes no settings, so it cannot be the cause. → Not PR-related; fix belongs in the regression test reference (or track as a base-branch issue).

7. Stateless (amd_asan_ubsan, cas s3 storage, parallel, 1/2) — flaky, reran green

04039_merge_tree_snapshot_teardown_race → Code: 210 ... CAS write could not be committed ... gave up at the lease deadline (NETWORK_ERROR)
praktika auto-rerun: "All reruns passed. The failure is not reproducible (likely a transient issue)."

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

03572_export_merge_tree_part_limits_and_table_functions → Timeout waiting for exports to complete after 60s
praktika auto-rerun: "All reruns passed. The failure is not reproducible (likely a transient issue)."

An export-completion timeout under load; nothing to do with ServerHello. → Safe to re-run.

(The top-level PR check is just the aggregate gate reflecting the above.)

PR health check

The change is tightly scoped and low-risk: a new Core/AntalyaProtocol.{h,cpp} with a self-contained marker grammar, the server appending " (antalya:N)" to server_name in TCPHandler::sendHello, and the client parsing + min-capping it in Connection::receiveHello. Parsing is defensive (rejects empty, leading-zero, overlong, and non-terminated markers; caps to the local version), and it rides inside the existing display string so older peers don't misread a new field — the design notes in docs/en/antalya/protocol.md match the code. The gtest and the two .expect updates cover it; the only real gap is coverage, not correctness:

  • tests/integration/test_antalya_protocol did not execute this run. The Integration tests (amd_asan_ubsan, targeted) job was skipped ("No failed tests found from previous runs"), and the arm/tsan/msan integration shards were excluded by tag. So the end-to-end negotiation test (new-vs-old worker, unmarked-vs-marked) hasn't actually run in CI yet. If you want it exercised before merge, push a trivial re-trigger or add the test_antalya_protocol path so the targeted job picks it up.

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.

@zvonand
zvonand merged commit b73e758 into antalya-26.6 Sep 29, 2026
356 of 368 checks passed
@zvonand zvonand added the verified Approved for release label Sep 29, 2026
zvonand added a commit that referenced this pull request Oct 2, 2026
…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
zvonand added a commit that referenced this pull request Oct 2, 2026
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`.
@zvonand zvonand removed the port-antalya PRs to be ported to all new Antalya releases label Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants