From 9028a30e9d4ce193faa40e820775bc38ecbfab9f Mon Sep 17 00:00:00 2001 From: boqiu <82121246@qq.com> Date: Thu, 5 Sep 2024 14:54:00 +0800 Subject: [PATCH] upload segment in right shard id --- tests/utility/submission.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/utility/submission.py b/tests/utility/submission.py index 1421811..a9fd80f 100644 --- a/tests/utility/submission.py +++ b/tests/utility/submission.py @@ -194,9 +194,14 @@ def generate_merkle_tree_by_batch(data): def submit_data(client, data): + shard_config = client.rpc.zgs_getShardConfig() + shard_id = int(shard_config["shardId"]) + num_shard = int(shard_config["numShard"]) + segments = data_to_segments(data) - for segment in segments: - client.zgs_upload_segment(segment) + for index, segment in enumerate(segments): + if index % num_shard == shard_id: + client.zgs_upload_segment(segment) return segments