-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix remote call of s3Cluster function #583
base: project-antalya-24.12.2
Are you sure you want to change the base?
Fix remote call of s3Cluster function #583
Conversation
@@ -2702,8 +2702,11 @@ void Context::setCurrentQueryId(const String & query_id) | |||
|
|||
client_info.current_query_id = query_id_to_set; | |||
|
|||
if (client_info.query_kind == ClientInfo::QueryKind::INITIAL_QUERY) | |||
if (client_info.query_kind == ClientInfo::QueryKind::INITIAL_QUERY | |||
&& (getApplicationType() != ApplicationType::SERVER || client_info.initial_query_id.empty())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the comment in ClientInfo.h
when query_kind == INITIAL_QUERY
initial_query_id is equal to current.
Does not it contradict with the condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it must be some new kind, something like REMOTE_INITIAL_QUERY
, but this breaks backward compatibility on protocol level.
@@ -442,6 +442,7 @@ void executeQuery( | |||
not_optimized_cluster->getName()); | |||
|
|||
read_from_remote->setStepDescription("Read from remote replica"); | |||
read_from_remote->setRemoteFunction(is_remote_function); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, "setIsRemoteFunction" is slightly more natural.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed
""" | ||
) | ||
|
||
assert TSV(pure_s3) == TSV(s3_distributed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the PR really s3Cluster specific?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, affects all *Cluster object storage functions. Suggest to make test for others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about new tests, may be. Depends on your feeling how probably is to break something that worked before or accidentally create a "bridge" that e.g. bypasses security.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added test for iceberg, most actual for us.
7473648
to
8b6064f
Compare
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix remote call of s3Cluster function
Documentation entry for user-facing changes
remote('remote_host', ''s3Cluster(.....)')
did not work with errorThe reason is this:
https://github.com/ClickHouse/ClickHouse/blob/master/src/TableFunctions/TableFunctionObjectStorageCluster.cpp#L34
s3Cluster
function has two stages, and stage is choose depends of query_kind - INITIAL_QUERY for first stage and SECONDARY_QUERY for second stage. Whens3Cluster
called fromremote
function, both stages were with SECONDARY_QUERY.Now requests from
remote
function useINITIAL_QUERY
.CI Settings (Only check the boxes if you know what you are doing):
CI Settings (Only check the boxes if you know what you are doing):