-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Distributed DDL improvements #21535
Distributed DDL improvements #21535
Conversation
} | ||
|
||
ClusterPtr new_cluster = getClusterImpl(); | ||
std::lock_guard lock{mutex}; |
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.
Maybe move this line above previous? Because many threads will try construct a cluster... And it seems that you can lock mutex only once at the beginning of the method without additional scopes.
@@ -120,7 +141,7 @@ ClusterPtr DatabaseReplicated::getCluster() const | |||
hosts = zookeeper->getChildren(zookeeper_path + "/replicas", &stat); | |||
if (hosts.empty()) | |||
throw Exception(ErrorCodes::LOGICAL_ERROR, "No hosts found"); | |||
Int32 cver = stat.cversion; | |||
Int32 cversion = stat.cversion; |
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 there any useful information inside /replicas
node itself (without children)? Maybe better to check version
in addition to cversion
?
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.
As for now /replicas
node does not store any informatin
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):
distributed_ddl_entry_format_version
to 2 to enable this.distributed_ddl_output_mode
setting. Supported modes:none
,throw
(default),null_status_on_timeout
andnever_throw
.Replicated
database engine.Detailed description / Documentation draft:
When
distributed_ddl_output_mode
is set tothrow
distributed DDL query returns result set with query execution status for all hosts where query is finished. If query has failed on some hosts, then it will rethrow the first exception. If query is not finished yet on some hosts anddistributed_ddl_task_timeout
exceeded, then it throwsTIMEOUT_EXCEEDED
exception.none
is similar tothrow
, but distributed DDL query returns no result set.null_status_on_timeout
means returnNULL
as execution status in some rows of result set instead of throwingTIMEOUT_EXCEEDED
if query is not finished on the corresponding hosts.never_throw
means do not throwTIMEOUT_EXCEEDED
and do not rethrow exceptions if query has failed on some hosts.