Repository navigation
Deprecate allow_experimental_query_deduplication feature - #99398
Conversation
|
Workflow [PR], commit [3872874] Summary: ❌
AI ReviewSummaryThis PR removes the experimental Findings
Tests
Final VerdictStatus: Minimum required actions: cap or fail-close the obsolete |
The setting is now obsolete (`MAKE_OBSOLETE`), so it should be in the ignore list rather than `enableAllExperimentalSettings.cpp`. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…-query-deduplication
It allows execution queries in cluster with previous server versions with unintentionally enabled allow_experimental_query_deduplication
| @@ -1466,9 +1466,6 @@ bool ClientBase::receiveAndProcessPacket(ASTPtr parsed_query, bool cancelled_) | |||
|
|
|||
| switch (packet.type) | |||
There was a problem hiding this comment.
Connection::receivePacket still tolerates Protocol::Server::PartUUIDs and returns a packet of that type, but ClientBase::receiveAndProcessPacket no longer handles it and now throws UNKNOWN_PACKET_FROM_SERVER in default.
This can break a newer clickhouse-client against an older server that still emits packet 12 when allow_experimental_query_deduplication is enabled.
Please keep ignoring Server::PartUUIDs here as well (like before) to preserve backward compatibility while the packet id remains reserved in Protocol.h.
There was a problem hiding this comment.
To my understanding, we should never get this packet on client side
azat
left a comment
There was a problem hiding this comment.
This is removal, not deprecation
Also let's add some reasons into description.
And do we want to keep other related parts (MOVE TO SHARD) for now and remove them later?
This change address only SELECT related part. AFAIU, |
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
….6 section Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…-query-deduplication
|
📊 Cloud Performance Report ✅ AI verdict: This PR removes the obsolete allow_experimental_query_deduplication feature: it deletes the part-UUID dedup plumbing (protocol packets, RemoteQueryExecutor retry path, and the UUID-filtered part selector) and turns the setting into a no-op. The setting defaulted to off, so the deleted code never ran for normal queries, and the single-node ClickBench scans/aggregations in Q4 and Q15 never exercise the distributed or part-selection paths that changed. The flagged -12% (Q4) and -14% (Q15) improvements therefore can't plausibly be caused by this change and read as run-to-run variance, especially with only 6 source runs and elevated measurement noise. Both have been downgraded to not-sure. clickbenchFlagged queries (2 of 43)
q-value = BH-FDR adjusted p; smaller is stronger evidence. MIRAI flags a query when q < fdr_q (default 0.10) — the value the verdict is based on. tpch_adapted_1_official🟢 No significant changes Debug info
|
| // materializing it (do not resize a vector to a peer-chosen size). | ||
| UInt64 num_part_uuids = 0; | ||
| readVarUInt(num_part_uuids, *in); | ||
| if (num_part_uuids > DEFAULT_MAX_STRING_SIZE) |
There was a problem hiding this comment.
The obsolete payload is still capped by UUID count, not by bytes. DEFAULT_MAX_STRING_SIZE is 1_GiB, so a peer can send num_part_uuids = DEFAULT_MAX_STRING_SIZE and make this client drain 16 GiB through ignore before the packet is ignored and processing continues.
Since Server::PartUUIDs is no longer supported, please cap the byte payload instead, for example reject when num_part_uuids > DEFAULT_MAX_STRING_SIZE / sizeof(UUID), or fail closed without draining when preserving framing is not required.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 122/148 (82.43%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code |
TCPHandler::receivePacketsExpectQuery() handles the packets that arrive
before any Query has been received. Its Data/Scalar case called
processUnexpectedData() and only then threw UNEXPECTED_PACKET_FROM_CLIENT.
That call builds a headerless NativeReader and reads a block, so the
column type name comes off the wire and is handed to DataTypeFactory.
Entering interserver mode requires only the name of a cluster that has a
non-empty <secret>, never the secret itself, and the secret is verified
only inside processQuery(), which this loop never reaches. So an
unauthenticated peer decided which type the server constructed and which
deserializer ran.
The read had no consumer for any peer either: its return value was
discarded, and the exception thrown right after is caught where
"if (!query_state) return;" exits runImpl, so the exception is never
sent, the connection is closed, and no further byte is read from the
socket. runImpl's exception handler already documents that policy ("the
server should not try to skip (parse, decompress) the remaining packets
sent by the client, as it will lead to additional work and unneeded
exposure to unauthenticated connections"); the parse it forbids had
already happened one frame earlier. The adjacent case of the same
switch, processObsoleteIgnoredPartUUIDs(), was given exactly this shape
in ClickHouse#99398.
No setting gates the rejection, deliberately. The TablesStatusRequest
path needed an operator opt-out when it was hardened in ClickHouse#99854 because
it was a served path, and rejecting it broke rolling upgrades (ClickHouse#113602).
Data before Query has always thrown, so there is no working flow to
preserve, and nothing a client can observe changes: the connection
closes with nothing written back, before and after.
The regression test completes an accepted interserver handshake over a
raw socket and then sends a Data packet declaring a column type that
does not exist. Without this change the server logs "Unknown data type
family: NoSuchTypeGroeneAI", which is the proof that a wire-supplied
type name reached DataTypeFactory before authentication. It is extended
into the existing pre-authentication interserver test module rather than
added as a new one, because that module already provides the cluster
with a <secret> and a handshake pinned below the chunked-packets
revision, which is what makes a hand-built packet feasible.
Requested by @ nikitamikhaylov, relayed via OranjeAI.
Co-Authored-By: Claude Opus 5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The change removes
allow_experimental_query_deduplicationfeature. The feature was experimental for a long time, has no tests and not going to be supported (initial tests were unstable and has been removed #49579)Documentation entry for user-facing changes