mirror of https://github.com/citusdata/citus.git
Add DELETE scenario
parent
c9844abea9
commit
a43cab7e71
|
@ -255,6 +255,7 @@ ShouldSlotHandleChange(char *slotName, ReorderBufferChange *change)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* split_change function emits the incoming tuple change
|
* split_change function emits the incoming tuple change
|
||||||
* to the appropriate destination shard.
|
* to the appropriate destination shard.
|
||||||
|
|
|
@ -199,3 +199,31 @@ SELECT * from table_to_split_3;
|
||||||
500 | a
|
500 | a
|
||||||
(2 rows)
|
(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)
|
||||||
|
|
||||||
|
|
|
@ -136,3 +136,16 @@ 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_1; -- should alwasy have zero rows
|
||||||
SELECT * from table_to_split_2;
|
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