Fix table function clusterAllReplicas return wrong _shard_num#21498
Fix table function clusterAllReplicas return wrong _shard_num#21498CurtizJ merged 2 commits intoClickHouse:masterfrom
Conversation
8beba28 to
37ff1f6
Compare
src/Interpreters/Cluster.cpp
Outdated
There was a problem hiding this comment.
Looks incorrect, because it will be incremented for all replicas and replicas from one shard will have different values.
There was a problem hiding this comment.
I think it's correct. This function only used for clusterAllReplicas which regard all replicas as independent shards.
There was a problem hiding this comment.
It create a new Cluster contains all replicas as shards.
There was a problem hiding this comment.
Let's just add functional test that shows that everything is correct for multi-replica shards.
There was a problem hiding this comment.
How can I add another cluster for test?
There was a problem hiding this comment.
Why I add cluster definition into server-test.xml or cluster.xml, the test still also show that cluster not found? @alexey-milovidov
There was a problem hiding this comment.
Why I add cluster definition into server-test.xml or cluster.xml, the test still also show that cluster not found?
AFAIK server-test.xml is not used anywhere (except for arcadia maybe), if you will add your cluster to tests/config/config.d/clusters.xml it should work.
FWIW fast-test (and other checks) got this configs via tests/config/install.sh, it already includes clusters.xml, here is a snippet from fast-test log:
+ ln -sf /ClickHouse/tests/config/config.d/clusters.xml /fasttest-workspace/db-fasttest/config.d/
Previous variant (f6e83b5) - https://clickhouse-test-reports.s3.yandex.net/21498/f6e83b579cc2b9db37b0a6315ee5633eaa6cf86a/fast_test.html#fail1 was failed because you set port to 59000, and this port is used only for arcadia tests AFAIR.
So to summarize you should add everything like in f6e83b579cc2b9db37b0a6315ee5633eaa6cf86a, but with default port.
|
Also, maybe it will be useful to have virtual column |
f6e83b5 to
4beb362
Compare
fix build on gcc-10 better update test fix fix fix fix fix fix cluster config
|
Commit 9f3ca62 is shown in changes of this PR, but it's already in master. I think it's because of several force-pushes. |
Backport #21498 to 21.3: Fix table function clusterAllReplicas return wrong _shard_num
Backport #21498 to 21.2: Fix table function clusterAllReplicas return wrong _shard_num
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix table function
clusterAllReplicasreturns wrong_shard_num. close #21481.