Skip to content

Commit cebd56e

Browse files
committed
fix attach partition
1 parent 02a9f71 commit cebd56e

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

alter/table/attach_partition/replica/add_remove_replica.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def add_remove_replicas(
3232
table_name=source_table_name,
3333
active_replicas=active_replicas,
3434
engine=engine,
35+
order_by="a"
3536
)
3637
join()
3738

@@ -154,13 +155,16 @@ def replica(self):
154155
table_name=destination_table_name,
155156
node=node,
156157
engine=destination_table_engine,
158+
order_by="a",
159+
157160
)
158161

159162
with And("I create source table on the first node and insert data"):
160163
create_one_replica(
161164
table_name=source_table_name,
162165
node=self.context.node_1,
163166
engine=source_table_engine,
167+
order_by="a",
164168
)
165169
insert_random(table_name=source_table_name, node=self.context.node_1)
166170
self.context.active_replicas.append(0)

alter/table/attach_partition/replica/common.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,11 @@ def create_replica_on_third_node(
359359

360360
@TestStep
361361
def add_remove_replica_on_first_node(
362-
self, table_name, active_replicas, engine, delay_before_delete=None
362+
self, table_name, active_replicas, engine, delay_before_delete=None, order_by="tuple()"
363363
):
364364
"Create replica on first node, wait less that 2 seconds and delete replica from the node."
365365
create_replica_on_first_node(
366-
table_name=table_name, active_replicas=active_replicas, engine=engine
366+
table_name=table_name, active_replicas=active_replicas, engine=engine, order_by=order_by
367367
)
368368

369369
if delay_before_delete is None:
@@ -380,11 +380,11 @@ def add_remove_replica_on_first_node(
380380

381381
@TestStep
382382
def add_remove_replica_on_second_node(
383-
self, table_name, active_replicas, engine, delay_before_delete=None
383+
self, table_name, active_replicas, engine, delay_before_delete=None, order_by="tuple()"
384384
):
385385
"Create replica on second node, wait less that 2 seconds and delete replica from the node."
386386
create_replica_on_second_node(
387-
table_name=table_name, active_replicas=active_replicas, engine=engine
387+
table_name=table_name, active_replicas=active_replicas, engine=engine, order_by=order_by
388388
)
389389

390390
if delay_before_delete is None:
@@ -401,13 +401,14 @@ def add_remove_replica_on_second_node(
401401

402402
@TestStep
403403
def add_remove_replica_on_third_node(
404-
self, table_name, active_replicas, engine, delay_before_delete=None
404+
self, table_name, active_replicas, engine, delay_before_delete=None, order_by="tuple()"
405405
):
406406
"Create replica on third node, wait less that 2 seconds and delete replica from the node."
407407
create_replica_on_third_node(
408408
table_name=table_name,
409409
active_replicas=active_replicas,
410410
engine=engine,
411+
order_by=order_by
411412
)
412413

413414
if delay_before_delete is None:

alter/table/attach_partition/temporary_table.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def check_attach_partition_detached_with_temporary_tables(self, table, engine):
3333
engine=engine,
3434
partition_by="a",
3535
node=client,
36+
order_by="a"
3637
)
3738

3839
table_before = client.query(
@@ -125,12 +126,14 @@ def check_attach_partition_from_with_temporary_tables(
125126
table_name=source_table_name,
126127
engine=source_table_engine,
127128
partition_by="a",
129+
order_by="a"
128130
)
129131
if "replicated" in destination_table.__name__:
130132
destination_table(
131133
table_name=destination_table_name,
132134
engine=destination_table_engine,
133135
partition_by="a",
136+
order_by="a"
134137
)
135138

136139
with Given("I open a single clickhouse instance"):
@@ -152,13 +155,17 @@ def check_attach_partition_from_with_temporary_tables(
152155
engine=source_table_engine,
153156
partition_by="a",
154157
node=client,
158+
order_by="a"
159+
155160
)
156161
if "replicated" not in destination_table.__name__:
157162
destination_table(
158163
table_name=destination_table_name,
159164
engine=destination_table_engine,
160165
partition_by="a",
161166
node=client,
167+
order_by="a"
168+
162169
)
163170

164171
with And(

0 commit comments

Comments
 (0)