mirror of https://github.com/citusdata/citus.git
isolation_create_restore_point: test reference tables too
parent
72c3d64ead
commit
9a31837647
|
@ -1,7 +1,7 @@
|
||||||
Parsed test spec with 2 sessions
|
Parsed test spec with 2 sessions
|
||||||
|
|
||||||
starting permutation: s1-begin s1-create-distributed s2-create-restore s1-commit
|
starting permutation: s1-begin s1-create-distributed s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -27,7 +27,7 @@ step s2-create-restore: <... completed>
|
||||||
1
|
1
|
||||||
|
|
||||||
starting permutation: s1-begin s1-insert s2-create-restore s1-commit
|
starting permutation: s1-begin s1-insert s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -48,7 +48,7 @@ step s1-commit:
|
||||||
|
|
||||||
|
|
||||||
starting permutation: s1-begin s1-modify-multiple s2-create-restore s1-commit
|
starting permutation: s1-begin s1-modify-multiple s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -69,7 +69,7 @@ step s1-commit:
|
||||||
|
|
||||||
|
|
||||||
starting permutation: s1-begin s1-ddl s2-create-restore s1-commit
|
starting permutation: s1-begin s1-ddl s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -90,7 +90,7 @@ step s1-commit:
|
||||||
|
|
||||||
|
|
||||||
starting permutation: s1-begin s1-copy s2-create-restore s1-commit
|
starting permutation: s1-begin s1-copy s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -111,7 +111,7 @@ step s1-commit:
|
||||||
|
|
||||||
|
|
||||||
starting permutation: s1-begin s1-recover s2-create-restore s1-commit
|
starting permutation: s1-begin s1-recover s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -136,7 +136,7 @@ step s2-create-restore: <... completed>
|
||||||
1
|
1
|
||||||
|
|
||||||
starting permutation: s1-begin s1-drop s2-create-restore s1-commit
|
starting permutation: s1-begin s1-drop s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -158,7 +158,7 @@ step s2-create-restore: <... completed>
|
||||||
1
|
1
|
||||||
|
|
||||||
starting permutation: s1-begin s1-add-node s2-create-restore s1-commit
|
starting permutation: s1-begin s1-add-node s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -183,7 +183,7 @@ step s2-create-restore: <... completed>
|
||||||
1
|
1
|
||||||
|
|
||||||
starting permutation: s1-begin s1-remove-node s2-create-restore s1-commit
|
starting permutation: s1-begin s1-remove-node s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -208,7 +208,7 @@ step s2-create-restore: <... completed>
|
||||||
1
|
1
|
||||||
|
|
||||||
starting permutation: s1-begin s1-create-restore s2-create-restore s1-commit
|
starting permutation: s1-begin s1-create-restore s2-create-restore s1-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
|
@ -233,7 +233,7 @@ step s2-create-restore: <... completed>
|
||||||
1
|
1
|
||||||
|
|
||||||
starting permutation: s2-begin s2-create-restore s1-modify-multiple s2-commit
|
starting permutation: s2-begin s2-create-restore s1-modify-multiple s2-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
|
@ -254,7 +254,7 @@ step s2-commit:
|
||||||
step s1-modify-multiple: <... completed>
|
step s1-modify-multiple: <... completed>
|
||||||
|
|
||||||
starting permutation: s2-begin s2-create-restore s1-ddl s2-commit
|
starting permutation: s2-begin s2-create-restore s1-ddl s2-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
|
@ -275,7 +275,7 @@ step s2-commit:
|
||||||
step s1-ddl: <... completed>
|
step s1-ddl: <... completed>
|
||||||
|
|
||||||
starting permutation: s2-begin s2-create-restore s1-multi-statement s2-commit
|
starting permutation: s2-begin s2-create-restore s1-multi-statement s2-commit
|
||||||
create_distributed_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
|
@ -298,3 +298,203 @@ step s2-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s1-multi-statement: <... completed>
|
step s1-multi-statement: <... completed>
|
||||||
|
|
||||||
|
starting permutation: s1-begin s1-create-reference s2-create-restore s1-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s1-begin:
|
||||||
|
BEGIN;
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
|
||||||
|
step s1-create-reference:
|
||||||
|
CREATE TABLE test_create_reference_table (test_id integer NOT NULL, data text);
|
||||||
|
SELECT create_reference_table('test_create_reference_table');
|
||||||
|
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
<waiting ...>
|
||||||
|
step s1-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
step s2-create-restore: <... completed>
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
|
||||||
|
starting permutation: s1-begin s1-insert-ref s2-create-restore s1-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s1-begin:
|
||||||
|
BEGIN;
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
|
||||||
|
step s1-insert-ref:
|
||||||
|
INSERT INTO restore_ref_table VALUES (1,'hello');
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
step s1-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
|
||||||
|
starting permutation: s1-begin s1-modify-multiple-ref s2-create-restore s1-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s1-begin:
|
||||||
|
BEGIN;
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
|
||||||
|
step s1-modify-multiple-ref:
|
||||||
|
UPDATE restore_ref_table SET data = 'world';
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
step s1-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
|
||||||
|
starting permutation: s1-begin s1-ddl-ref s2-create-restore s1-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s1-begin:
|
||||||
|
BEGIN;
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
|
||||||
|
step s1-ddl-ref:
|
||||||
|
ALTER TABLE restore_ref_table ADD COLUMN x int;
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
<waiting ...>
|
||||||
|
step s1-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
step s2-create-restore: <... completed>
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
|
||||||
|
starting permutation: s1-begin s1-copy-ref s2-create-restore s1-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s1-begin:
|
||||||
|
BEGIN;
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
|
||||||
|
step s1-copy-ref:
|
||||||
|
COPY restore_ref_table FROM PROGRAM 'echo 1,hello' WITH CSV;
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
step s1-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
|
||||||
|
starting permutation: s1-begin s1-drop-ref s2-create-restore s1-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s1-begin:
|
||||||
|
BEGIN;
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
|
||||||
|
step s1-drop-ref:
|
||||||
|
DROP TABLE restore_ref_table;
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
<waiting ...>
|
||||||
|
step s1-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
step s2-create-restore: <... completed>
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
|
||||||
|
starting permutation: s2-begin s2-create-restore s1-modify-multiple-ref s2-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s2-begin:
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
step s1-modify-multiple-ref:
|
||||||
|
UPDATE restore_ref_table SET data = 'world';
|
||||||
|
<waiting ...>
|
||||||
|
step s2-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
step s1-modify-multiple-ref: <... completed>
|
||||||
|
|
||||||
|
starting permutation: s2-begin s2-create-restore s1-ddl-ref s2-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s2-begin:
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
step s1-ddl-ref:
|
||||||
|
ALTER TABLE restore_ref_table ADD COLUMN x int;
|
||||||
|
<waiting ...>
|
||||||
|
step s2-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
step s1-ddl-ref: <... completed>
|
||||||
|
|
||||||
|
starting permutation: s2-begin s2-create-restore s1-multi-statement-ref s2-commit
|
||||||
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
|
step s2-begin:
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
step s2-create-restore:
|
||||||
|
SELECT 1 FROM citus_create_restore_point('citus-test');
|
||||||
|
|
||||||
|
?column?
|
||||||
|
|
||||||
|
1
|
||||||
|
step s1-multi-statement-ref:
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
BEGIN;
|
||||||
|
INSERT INTO restore_ref_table VALUES (1,'hello');
|
||||||
|
INSERT INTO restore_ref_table VALUES (2,'hello');
|
||||||
|
COMMIT;
|
||||||
|
<waiting ...>
|
||||||
|
step s2-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
step s1-multi-statement-ref: <... completed>
|
||||||
|
|
|
@ -2,12 +2,14 @@ setup
|
||||||
{
|
{
|
||||||
SET citus.shard_replication_factor TO 1;
|
SET citus.shard_replication_factor TO 1;
|
||||||
CREATE TABLE restore_table (test_id integer NOT NULL, data text);
|
CREATE TABLE restore_table (test_id integer NOT NULL, data text);
|
||||||
|
CREATE TABLE restore_ref_table (test_id integer NOT NULL, data text);
|
||||||
SELECT create_distributed_table('restore_table', 'test_id');
|
SELECT create_distributed_table('restore_table', 'test_id');
|
||||||
|
SELECT create_reference_table('restore_ref_table');
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown
|
teardown
|
||||||
{
|
{
|
||||||
DROP TABLE IF EXISTS restore_table, test_create_distributed_table;
|
DROP TABLE IF EXISTS restore_table, restore_ref_table, test_create_distributed_table, test_create_reference_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
session "s1"
|
session "s1"
|
||||||
|
@ -18,6 +20,12 @@ step "s1-begin"
|
||||||
SET citus.multi_shard_commit_protocol TO '2pc';
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step "s1-create-reference"
|
||||||
|
{
|
||||||
|
CREATE TABLE test_create_reference_table (test_id integer NOT NULL, data text);
|
||||||
|
SELECT create_reference_table('test_create_reference_table');
|
||||||
|
}
|
||||||
|
|
||||||
step "s1-create-distributed"
|
step "s1-create-distributed"
|
||||||
{
|
{
|
||||||
CREATE TABLE test_create_distributed_table (test_id integer NOT NULL, data text);
|
CREATE TABLE test_create_distributed_table (test_id integer NOT NULL, data text);
|
||||||
|
@ -29,11 +37,30 @@ step "s1-insert"
|
||||||
INSERT INTO restore_table VALUES (1,'hello');
|
INSERT INTO restore_table VALUES (1,'hello');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step "s1-insert-ref"
|
||||||
|
{
|
||||||
|
INSERT INTO restore_ref_table VALUES (1,'hello');
|
||||||
|
}
|
||||||
|
|
||||||
step "s1-modify-multiple"
|
step "s1-modify-multiple"
|
||||||
{
|
{
|
||||||
UPDATE restore_table SET data = 'world';
|
UPDATE restore_table SET data = 'world';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step "s1-modify-multiple-ref"
|
||||||
|
{
|
||||||
|
UPDATE restore_ref_table SET data = 'world';
|
||||||
|
}
|
||||||
|
|
||||||
|
step "s1-multi-statement-ref"
|
||||||
|
{
|
||||||
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
BEGIN;
|
||||||
|
INSERT INTO restore_ref_table VALUES (1,'hello');
|
||||||
|
INSERT INTO restore_ref_table VALUES (2,'hello');
|
||||||
|
COMMIT;
|
||||||
|
}
|
||||||
|
|
||||||
step "s1-multi-statement"
|
step "s1-multi-statement"
|
||||||
{
|
{
|
||||||
SET citus.multi_shard_commit_protocol TO '2pc';
|
SET citus.multi_shard_commit_protocol TO '2pc';
|
||||||
|
@ -43,11 +70,21 @@ step "s1-multi-statement"
|
||||||
COMMIT;
|
COMMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step "s1-ddl-ref"
|
||||||
|
{
|
||||||
|
ALTER TABLE restore_ref_table ADD COLUMN x int;
|
||||||
|
}
|
||||||
|
|
||||||
step "s1-ddl"
|
step "s1-ddl"
|
||||||
{
|
{
|
||||||
ALTER TABLE restore_table ADD COLUMN x int;
|
ALTER TABLE restore_table ADD COLUMN x int;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step "s1-copy-ref"
|
||||||
|
{
|
||||||
|
COPY restore_ref_table FROM PROGRAM 'echo 1,hello' WITH CSV;
|
||||||
|
}
|
||||||
|
|
||||||
step "s1-copy"
|
step "s1-copy"
|
||||||
{
|
{
|
||||||
COPY restore_table FROM PROGRAM 'echo 1,hello' WITH CSV;
|
COPY restore_table FROM PROGRAM 'echo 1,hello' WITH CSV;
|
||||||
|
@ -68,6 +105,11 @@ step "s1-drop"
|
||||||
DROP TABLE restore_table;
|
DROP TABLE restore_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step "s1-drop-ref"
|
||||||
|
{
|
||||||
|
DROP TABLE restore_ref_table;
|
||||||
|
}
|
||||||
|
|
||||||
step "s1-add-node"
|
step "s1-add-node"
|
||||||
{
|
{
|
||||||
SELECT 1 FROM master_add_inactive_node('localhost', 9999);
|
SELECT 1 FROM master_add_inactive_node('localhost', 9999);
|
||||||
|
@ -136,5 +178,32 @@ permutation "s2-begin" "s2-create-restore" "s1-modify-multiple" "s2-commit"
|
||||||
# verify that DDL is blocked by concurrent citus_create_restore_point
|
# verify that DDL is blocked by concurrent citus_create_restore_point
|
||||||
permutation "s2-begin" "s2-create-restore" "s1-ddl" "s2-commit"
|
permutation "s2-begin" "s2-create-restore" "s1-ddl" "s2-commit"
|
||||||
|
|
||||||
# verify that multi-statement transactions is blocked by concurrent citus_create_restore_point
|
# verify that multi-statement transactions are blocked by concurrent citus_create_restore_point
|
||||||
permutation "s2-begin" "s2-create-restore" "s1-multi-statement" "s2-commit"
|
permutation "s2-begin" "s2-create-restore" "s1-multi-statement" "s2-commit"
|
||||||
|
|
||||||
|
# verify that citus_create_restore_point is blocked by concurrent create_reference_table
|
||||||
|
permutation "s1-begin" "s1-create-reference" "s2-create-restore" "s1-commit"
|
||||||
|
|
||||||
|
# verify that citus_create_restore_point is not blocked by concurrent reference table INSERT (only commit)
|
||||||
|
permutation "s1-begin" "s1-insert-ref" "s2-create-restore" "s1-commit"
|
||||||
|
|
||||||
|
# verify that citus_create_restore_point is not blocked by concurrent reference table UPDATE (only commit)
|
||||||
|
permutation "s1-begin" "s1-modify-multiple-ref" "s2-create-restore" "s1-commit"
|
||||||
|
|
||||||
|
# verify that citus_create_restore_point is not blocked by concurrent refence table DDL (only commit)
|
||||||
|
permutation "s1-begin" "s1-ddl-ref" "s2-create-restore" "s1-commit"
|
||||||
|
|
||||||
|
# verify that citus_create_restore_point is not blocked by concurrent COPY to reference table (only commit)
|
||||||
|
permutation "s1-begin" "s1-copy-ref" "s2-create-restore" "s1-commit"
|
||||||
|
|
||||||
|
# verify that citus_create_restore_point is blocked by concurrent DROP TABLE when table is a reference table
|
||||||
|
permutation "s1-begin" "s1-drop-ref" "s2-create-restore" "s1-commit"
|
||||||
|
|
||||||
|
# verify that reference table UPDATE is blocked by concurrent citus_create_restore_point
|
||||||
|
permutation "s2-begin" "s2-create-restore" "s1-modify-multiple-ref" "s2-commit"
|
||||||
|
|
||||||
|
# verify that reference table DDL is blocked by concurrent citus_create_restore_point
|
||||||
|
permutation "s2-begin" "s2-create-restore" "s1-ddl-ref" "s2-commit"
|
||||||
|
|
||||||
|
# verify that multi-statement transactions with reference tables are blocked by concurrent citus_create_restore_point
|
||||||
|
permutation "s2-begin" "s2-create-restore" "s1-multi-statement-ref" "s2-commit"
|
||||||
|
|
Loading…
Reference in New Issue