Add DELETE scenario

users/saawasek/non_blocking_split_integrated
Sameer Awasekar 2022-05-19 17:05:42 +05:30
parent c9844abea9
commit a43cab7e71
3 changed files with 46 additions and 4 deletions

View File

@ -255,10 +255,11 @@ ShouldSlotHandleChange(char *slotName, ReorderBufferChange *change)
return true;
}
/*
* split_change function emits the incoming tuple change
* to the appropriate destination shard.
*/
* split_change function emits the incoming tuple change
* to the appropriate destination shard.
*/
static void
split_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
Relation relation, ReorderBufferChange *change)

View File

@ -199,3 +199,31 @@ SELECT * from table_to_split_3;
500 | a
(2 rows)
-- Delete data from table_to_split_1 from worker1
\c - - - :worker_1_port
SET search_path TO citus_split_shard_by_split_points;
DELETE FROM table_to_split_1;
SELECT pg_sleep(10);
pg_sleep
---------------------------------------------------------------------
(1 row)
-- Child shard rows should be deleted
\c - - - :worker_2_port
SET search_path TO citus_split_shard_by_split_points;
SELECT * FROM table_to_split_1;
id | value
---------------------------------------------------------------------
(0 rows)
SELECT * FROM table_to_split_2;
id | value
---------------------------------------------------------------------
(0 rows)
SELECT * FROM table_to_split_3;
id | value
---------------------------------------------------------------------
(0 rows)

View File

@ -135,4 +135,17 @@ select pg_sleep(10);
SET search_path TO citus_split_shard_by_split_points;
SELECT * from table_to_split_1; -- should alwasy have zero rows
SELECT * from table_to_split_2;
SELECT * from table_to_split_3;
SELECT * from table_to_split_3;
-- Delete data from table_to_split_1 from worker1
\c - - - :worker_1_port
SET search_path TO citus_split_shard_by_split_points;
DELETE FROM table_to_split_1;
SELECT pg_sleep(10);
-- Child shard rows should be deleted
\c - - - :worker_2_port
SET search_path TO citus_split_shard_by_split_points;
SELECT * FROM table_to_split_1;
SELECT * FROM table_to_split_2;
SELECT * FROM table_to_split_3;