-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metatdata cleaner with system drop replica
- Loading branch information
1 parent
8e11eb0
commit de6a77d
Showing
5 changed files
with
334 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from ch_tools.chadmin.internal.utils import execute_query | ||
|
||
|
||
def system_database_drop_replica(ctx, database_zk_path, replica, dry_run=False): | ||
""" | ||
Perform "SYSTEM DROP DATABASE REPLICA" query. | ||
""" | ||
timeout = ctx.obj["config"]["clickhouse"]["drop_replica_timeout"] | ||
query = f"SYSTEM DROP DATABASE REPLICA '{replica}' FROM ZKPATH '{database_zk_path}'" | ||
execute_query(ctx, query, timeout=timeout, echo=True, dry_run=dry_run, format_=None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.