Skip to content

Commit

Permalink
Add logging for zookeeper's mark_finished_ddl_query
Browse files Browse the repository at this point in the history
  • Loading branch information
MedvedewEM committed Mar 12, 2024
1 parent 986522e commit 34c81dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ch_tools/chadmin/internal/zookeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,19 @@ def mark_finished_ddl_query(zk):

for ddl_task in _get_children(zk, _format_path(ctx, zk_ddl_query_path)):
ddl_task_full = os.path.join(zk_ddl_query_path, ddl_task)
print(f"DDL task full path: {ddl_task_full}")
for host in nodes:
host_mention = get_host_mention_in_task(zk, host, ddl_task_full)
if not host_mention:
print("Host is not mentioned in DDL task value")
continue
finished_path = os.path.join(ddl_task_full, f"finished/{host_mention}")
if zk.exists(finished_path):
print(f"Finished path already exists: {finished_path}")
continue
print(f"Add {host} to finished for ddl_task: {ddl_task}")
zk.create(finished_path, b"0\n")
print("Finish mark ddl query")

zk_root_path = _format_path(ctx, "/")
with zk_client(ctx) as zk:
Expand Down

0 comments on commit 34c81dd

Please sign in to comment.