Repository navigation
Direct join under parallel replicas + serialize_query_plan - #105260
devcrafter wants to merge 4 commits into
Conversation
The test exercises a very specific configuration (parallel replicas + `parallel_replicas_local_plan = 0` + `join_algorithm = direct` + `serialize_query_plan = 1`) to assert that serialization of `JoinStepLogicalLookup` raises `NOT_IMPLEMENTED`. Random settings in the flaky check can change the plan so the lookup step is not reached remotely, the query succeeds, and the test fails with "query succeeded but server error '48' was expected". CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=97261&sha=0537180f689f5e8f09d034af910c5b6800f9d739&name_0=PR&name_1=Stateless+tests+%28amd_asan_ubsan%2C+flaky+check%29 PR: #97261 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Workflow [PR], commit [74f8712] Summary: ❌
AI ReviewSummaryThis PR threads Findings❌ Blockers
Final VerdictStatus: Minimum required actions:
|
| flags |= 4; | ||
| if (use_parallel_replicas) | ||
| if (is_merge_tree) | ||
| flags |= 8; |
There was a problem hiding this comment.
This repurposes flag bit 8 from use_parallel_replicas to is_merge_tree and moves use_parallel_replicas to bit 16, while DBMS_QUERY_PLAN_SERIALIZATION_VERSION stays 0.
That changes the v0 wire contract for ReadFromTableStep: mixed-version nodes with serialize_query_plan = 1 will not agree on bit meanings and can deserialize the step incorrectly.
Please keep existing bit semantics for v0 (leave use_parallel_replicas on bit 8 and use a new bit for is_merge_tree), or bump/version-gate query-plan serialization.
|
|
||
| SYSTEM ENABLE FAILPOINT parallel_replicas_wait_for_unused_replicas; | ||
|
|
||
| SELECT t0.Id, sum(sipHash64(t0.Payload)), count(), countIf(t1.Attribute != ''), sum(sipHash64(t1.Attribute)) AS attr_hash_sum |
There was a problem hiding this comment.
The test body says this query should document the current NOT_IMPLEMENTED limitation (until JoinStepLogicalLookup::serialize exists), but this line has no expected-error annotation. In 0_stateless tests that means a NOT_IMPLEMENTED exception makes the test fail instead of pass.
Please add an explicit expectation on this query (for example -- { serverError NOT_IMPLEMENTED }) so the test actually validates the intended contract.
There was a problem hiding this comment.
This is still live in the current patch: the test body says we are documenting the current NOT_IMPLEMENTED limitation until JoinStepLogicalLookup::serialize exists, but this SELECT still has no expected-error annotation.
Without an explicit -- { serverError NOT_IMPLEMENTED } expectation on this statement, the test contract does not match the stated behavior.
The direct-join regression test was extracted into PR #105260 along with its `ReadFromTableStep::is_merge_tree` dependency. Drop it from this branch; it'll come back via the merge from master once #105260 lands. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Dear @devcrafter, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
The direct-join regression test was extracted into PR ClickHouse#105260 along with its `ReadFromTableStep::is_merge_tree` dependency. Drop it from this branch; it'll come back via the merge from master once ClickHouse#105260 lands. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…f_rows_per_replica` - `03518_key_condition_binary_search` counts index search profile events. The extra plan that estimates the rows to read runs the index analysis again, so pin the setting to `0`. - `02769_parallel_replicas_unavailable_shards` expects the unavailable replica to be picked. A positive value lowers the number of replicas for the 10-row table, so the counter stays `0`. - `05452_pr_min_rows_estimate_direct_join_merge_tree` flakily failed in the `distributed plan` job: a remote replica that receives a serialized query plan cannot build a direct join yet (#105260). The test is about the plan built on the initiator, so it now sets `serialize_query_plan = 0`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=71028&sha=6494bace60a09a4c9e5697f5a0d03ed06a4e36d9&name_0=PR PR: #71028 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Dear @devcrafter, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
|
Not actualy anymore, serialized query plan is replaced by plan based parallel replicas development |
Changelog category (leave one):
Adds a regression test
04034_pr_direct_jointhat exercises the failing direct-join shape under parallel replicas +serialize_query_plan = 1. UntilJoinStepLogicalLookup::serializeis implemented, the query is asserted to fail withNOT_IMPLEMENTEDon the remote node.Also threads
is_merge_treethroughReadFromTableStepso the replica-side reconstruction can pick the right read path for direct joins, plus a small touch-up inPlannerJoinTree.cppandClusterProxy/executeQuery.cppcarrying the additional state.Two commits:
is_merge_treetoReadFromTableStep, threads it through serialization and the planner, plus the new regression test that documents the current limitation.04034_pr_direct_joinstable under random settings — tags the test so random-settings randomization doesn't change the plan shape underneath it.