mirror of https://github.com/citusdata/citus.git
Add DELETE scenario
parent
c9844abea9
commit
a43cab7e71
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue