Fix metadata sync fails on multi_truncate

pull/5576/head
Halil Ozan Akgul 2021-12-27 11:27:32 +03:00
parent c9127f921f
commit 0c292a74f5
3 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

@ -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

View File

@ -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);