Skip to content

Commit 809109b

Browse files
committed
chore: randomize more and name non-sharded backups noshard
1 parent f709d58 commit 809109b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

housewatch/clickhouse/backups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def execute_backup(
3636
nodes = get_node_per_shard(cluster)
3737
responses = []
3838
for shard, node in nodes:
39-
params["shard"] = shard
39+
params["shard"] = shard if is_sharded else "noshard"
4040
if base_backup:
4141
query_settings["base_backup"] = f"S3('{base_backup}/{shard}', '{aws_key}', '{aws_secret}')"
4242
final_query = query % (params or {}) if substitute_params else query

housewatch/clickhouse/clusters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ def get_node_per_shard(cluster):
4848
break
4949
if not preferred_replica_found:
5050
nodes.append((shard, random.choice(n)))
51+
random.shuffle(nodes)
5152
return nodes

0 commit comments

Comments
 (0)