Update isolation tests

niupre/TestDeferredDropAndCleanup
Nitish Upreti 2022-08-28 16:45:47 -07:00
parent e9e64eb3e7
commit d3442e2e04
5 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,13 @@ setup
SET citus.shard_replication_factor to 1; SET citus.shard_replication_factor to 1;
SELECT setval('pg_dist_shardid_seq', 1500000); SELECT setval('pg_dist_shardid_seq', 1500000);
-- Cleanup any orphan shards that might be left over from a previous run.
CREATE OR REPLACE FUNCTION run_try_drop_marked_shards()
RETURNS VOID
AS 'citus'
LANGUAGE C STRICT VOLATILE;
SELECT run_try_drop_marked_shards();
CREATE TABLE to_split_table (id int, value int); CREATE TABLE to_split_table (id int, value int);
SELECT create_distributed_table('to_split_table', 'id'); SELECT create_distributed_table('to_split_table', 'id');
} }

View File

@ -4,6 +4,13 @@ setup
SET citus.shard_count to 2; SET citus.shard_count to 2;
SET citus.shard_replication_factor to 1; SET citus.shard_replication_factor to 1;
-- Cleanup any orphan shards that might be left over from a previous run.
CREATE OR REPLACE FUNCTION run_try_drop_marked_shards()
RETURNS VOID
AS 'citus'
LANGUAGE C STRICT VOLATILE;
SELECT run_try_drop_marked_shards();
CREATE TABLE reference_table (id int PRIMARY KEY, value int); CREATE TABLE reference_table (id int PRIMARY KEY, value int);
SELECT create_reference_table('reference_table'); SELECT create_reference_table('reference_table');

View File

@ -10,6 +10,13 @@ setup
SET citus.shard_replication_factor to 1; SET citus.shard_replication_factor to 1;
SELECT setval('pg_dist_shardid_seq', 1500000); SELECT setval('pg_dist_shardid_seq', 1500000);
-- Cleanup any orphan shards that might be left over from a previous run.
CREATE OR REPLACE FUNCTION run_try_drop_marked_shards()
RETURNS VOID
AS 'citus'
LANGUAGE C STRICT VOLATILE;
SELECT run_try_drop_marked_shards();
CREATE TABLE to_split_table (id int PRIMARY KEY, value int); CREATE TABLE to_split_table (id int PRIMARY KEY, value int);
SELECT create_distributed_table('to_split_table', 'id'); SELECT create_distributed_table('to_split_table', 'id');
} }

View File

@ -10,6 +10,13 @@ setup
SET citus.shard_count to 2; SET citus.shard_count to 2;
SET citus.shard_replication_factor to 1; SET citus.shard_replication_factor to 1;
-- Cleanup any orphan shards that might be left over from a previous run.
CREATE OR REPLACE FUNCTION run_try_drop_marked_shards()
RETURNS VOID
AS 'citus'
LANGUAGE C STRICT VOLATILE;
SELECT run_try_drop_marked_shards();
CREATE TABLE reference_table (id int PRIMARY KEY, value int); CREATE TABLE reference_table (id int PRIMARY KEY, value int);
SELECT create_reference_table('reference_table'); SELECT create_reference_table('reference_table');

View File

@ -9,6 +9,13 @@ setup
SET citus.shard_replication_factor to 1; SET citus.shard_replication_factor to 1;
SELECT setval('pg_dist_shardid_seq', 1500000); SELECT setval('pg_dist_shardid_seq', 1500000);
-- Cleanup any orphan shards that might be left over from a previous run.
CREATE OR REPLACE FUNCTION run_try_drop_marked_shards()
RETURNS VOID
AS 'citus'
LANGUAGE C STRICT VOLATILE;
SELECT run_try_drop_marked_shards();
CREATE TABLE to_split_table (id int NOT NULL, value int); CREATE TABLE to_split_table (id int NOT NULL, value int);
CREATE UNIQUE INDEX split_table_index ON to_split_table(id); CREATE UNIQUE INDEX split_table_index ON to_split_table(id);
ALTER TABLE to_split_table REPLICA IDENTITY USING INDEX split_table_index; ALTER TABLE to_split_table REPLICA IDENTITY USING INDEX split_table_index;