From 0c292a74f52ba04136b6ab1de752a6f3fcbf2b5c Mon Sep 17 00:00:00 2001 From: Halil Ozan Akgul Date: Mon, 27 Dec 2021 11:27:32 +0300 Subject: [PATCH] Fix metadata sync fails on multi_truncate --- src/test/regress/expected/multi_truncate.out | 3 +++ src/test/regress/multi_1_schedule | 4 ++-- src/test/regress/sql/multi_truncate.sql | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/test/regress/expected/multi_truncate.out b/src/test/regress/expected/multi_truncate.out index c21a65fee..7ac388661 100644 --- a/src/test/regress/expected/multi_truncate.out +++ b/src/test/regress/expected/multi_truncate.out @@ -333,6 +333,7 @@ SELECT citus_drop_all_shards('test_local_truncate', 'public', 'test_local_trunca 4 (1 row) +CREATE TABLE temp_pg_dist_partition_row AS SELECT * FROM pg_dist_partition WHERE logicalrelid = 'test_local_truncate'::regclass; DELETE FROM pg_dist_partition WHERE logicalrelid = 'test_local_truncate'::regclass; -- Ensure local data is truncated SELECT * FROM test_local_truncate; @@ -340,7 +341,9 @@ SELECT * FROM test_local_truncate; --------------------------------------------------------------------- (0 rows) +INSERT INTO pg_dist_partition SELECT * FROM temp_pg_dist_partition_row; DROP TABLE test_local_truncate; +DROP TABLE temp_pg_dist_partition_row; -- Truncate local data, but roll back CREATE TABLE test_local_truncate (x int, y int); INSERT INTO test_local_truncate VALUES (1,2); diff --git a/src/test/regress/multi_1_schedule b/src/test/regress/multi_1_schedule index 33dfa1efc..840cd599f 100644 --- a/src/test/regress/multi_1_schedule +++ b/src/test/regress/multi_1_schedule @@ -247,14 +247,14 @@ test: multi_function_evaluation # ---------- # multi_truncate tests truncate functionality for distributed tables # ---------- -test: check_mx -test: turn_mx_off test: multi_truncate # ---------- # multi_colocation_utils tests utility functions written for co-location feature & internal API # multi_colocated_shard_transfer tests master_copy_shard_placement with colocated tables. # ---------- +test: check_mx +test: turn_mx_off test: multi_colocation_utils test: turn_mx_on test: multi_colocated_shard_transfer diff --git a/src/test/regress/sql/multi_truncate.sql b/src/test/regress/sql/multi_truncate.sql index 25b582633..83b4da202 100644 --- a/src/test/regress/sql/multi_truncate.sql +++ b/src/test/regress/sql/multi_truncate.sql @@ -206,12 +206,15 @@ SELECT * FROM test_local_truncate; -- Undistribute table SELECT citus_drop_all_shards('test_local_truncate', 'public', 'test_local_truncate'); +CREATE TABLE temp_pg_dist_partition_row AS SELECT * FROM pg_dist_partition WHERE logicalrelid = 'test_local_truncate'::regclass; DELETE FROM pg_dist_partition WHERE logicalrelid = 'test_local_truncate'::regclass; -- Ensure local data is truncated SELECT * FROM test_local_truncate; +INSERT INTO pg_dist_partition SELECT * FROM temp_pg_dist_partition_row; DROP TABLE test_local_truncate; +DROP TABLE temp_pg_dist_partition_row; -- Truncate local data, but roll back CREATE TABLE test_local_truncate (x int, y int);