diff --git a/src/test/regress/expected/isolation_partition.out b/src/test/regress/expected/isolation_partition.out new file mode 100644 index 000000000..7fdf2278c --- /dev/null +++ b/src/test/regress/expected/isolation_partition.out @@ -0,0 +1,61 @@ +Parsed test spec with 2 sessions + +starting permutation: s1-begin s1-update s2-drop s1-commit +step s1-begin: + BEGIN; + +step s1-update: + update test_9_1 set destination = 1; + +step s2-drop: + drop table test_6_1; + +step s1-commit: + COMMIT; + +step s2-drop: <... completed> + +starting permutation: s2-begin s2-drop s1-update s2-commit +step s2-begin: + BEGIN; + +step s2-drop: + drop table test_6_1; + +step s1-update: + update test_9_1 set destination = 1; + +step s2-commit: + COMMIT; + +step s1-update: <... completed> + +starting permutation: s1-begin s1-update s2-create s1-commit +step s1-begin: + BEGIN; + +step s1-update: + update test_9_1 set destination = 1; + +step s2-create: + CREATE TABLE test_10_1 PARTITION OF test FOR VALUES FROM ('10', '2021-07-16') TO ('11', '2021-07-17'); + +step s1-commit: + COMMIT; + +step s2-create: <... completed> + +starting permutation: s2-begin s2-create s1-update s2-commit +step s2-begin: + BEGIN; + +step s2-create: + CREATE TABLE test_10_1 PARTITION OF test FOR VALUES FROM ('10', '2021-07-16') TO ('11', '2021-07-17'); + +step s1-update: + update test_9_1 set destination = 1; + +step s2-commit: + COMMIT; + +step s1-update: <... completed> diff --git a/src/test/regress/isolation_schedule b/src/test/regress/isolation_schedule index 208d7e228..8206643a0 100644 --- a/src/test/regress/isolation_schedule +++ b/src/test/regress/isolation_schedule @@ -65,6 +65,7 @@ test: isolation_multiuser_locking test: shared_connection_waits test: isolation_cancellation test: isolation_undistribute_table +test: isolation_partition # Rebalancer test: isolation_blocking_move_single_shard_commands diff --git a/src/test/regress/spec/isolation_partition.spec b/src/test/regress/spec/isolation_partition.spec new file mode 100644 index 000000000..ceb849b47 --- /dev/null +++ b/src/test/regress/spec/isolation_partition.spec @@ -0,0 +1,61 @@ +setup +{ + SET citus.shard_replication_factor to 1; + CREATE TABLE test( + time date, + id bigint, + name character varying, + destination bigint) PARTITION BY RANGE (id, time); + + SELECT create_distributed_table('test', 'name'); + + CREATE TABLE test_6_1 PARTITION OF test FOR VALUES FROM ('6', '2021-07-12') TO ('6', '2021-07-13'); + CREATE TABLE test_7_1 PARTITION OF test FOR VALUES FROM ('7', '2021-07-13') TO ('8', '2021-07-14'); + CREATE TABLE test_8_1 PARTITION OF test FOR VALUES FROM ('8', '2021-07-14') TO ('9', '2021-07-15'); + CREATE TABLE test_9_1 PARTITION OF test FOR VALUES FROM ('9', '2021-07-15') TO ('10', '2021-07-16'); + + +} + +teardown +{ + DROP TABLE IF EXISTS test CASCADE; +} + +session "s1" + +step "s1-begin" { + BEGIN; +} + +step "s1-update" { + update test_9_1 set destination = 1; +} + +step "s1-commit" { + COMMIT; +} + +session "s2" + +step "s2-begin" { + BEGIN; +} + +step "s2-drop" { + drop table test_6_1; +} + +step "s2-create" { + CREATE TABLE test_10_1 PARTITION OF test FOR VALUES FROM ('10', '2021-07-16') TO ('11', '2021-07-17'); + +} + +step "s2-commit" { + COMMIT; +} + +permutation "s1-begin" "s1-update" "s2-drop" "s1-commit" +permutation "s2-begin" "s2-drop" "s1-update" "s2-commit" +permutation "s1-begin" "s1-update" "s2-create" "s1-commit" +permutation "s2-begin" "s2-create" "s1-update" "s2-commit"