the tests are separated and some more added

pull/1798/head
mehmet furkan şahin 2017-11-15 15:16:27 +03:00
parent 636faadc47
commit 8d55754b4d
7 changed files with 342 additions and 149 deletions

View File

@ -0,0 +1,102 @@
Parsed test spec with 2 sessions
starting permutation: s1-begin s2-begin s1-create_distributed_table s2-create_distributed_table s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
create_distributed_table
step s2-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
<waiting ...>
step s1-commit:
COMMIT;
step s2-create_distributed_table: <... completed>
error in steps s1-commit s2-create_distributed_table: ERROR: table "table_to_distribute" is already distributed
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-create_distributed_table s2-copy_to_local_table s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
create_distributed_table
step s2-copy_to_local_table:
COPY table_to_distribute FROM PROGRAM 'echo "0\n1\n2\n3\n4\n5\n6\n7\n8"';
<waiting ...>
step s1-commit:
COMMIT;
step s2-copy_to_local_table: <... completed>
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s2-copy_to_local_table s1-create_distributed_table s2-commit s1-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s2-copy_to_local_table:
COPY table_to_distribute FROM PROGRAM 'echo "0\n1\n2\n3\n4\n5\n6\n7\n8"';
step s1-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
<waiting ...>
step s2-commit:
COMMIT;
step s1-create_distributed_table: <... completed>
create_distributed_table
step s1-commit:
COMMIT;
starting permutation: s1-copy_to_local_table s1-begin s2-begin s1-create_distributed_table s2-create_distributed_table s1-commit s2-commit
step s1-copy_to_local_table:
COPY table_to_distribute FROM PROGRAM 'echo "0\n1\n2\n3\n4\n5\n6\n7\n8"';
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
create_distributed_table
step s2-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
<waiting ...>
step s1-commit:
COMMIT;
step s2-create_distributed_table: <... completed>
error in steps s1-commit s2-create_distributed_table: ERROR: table "table_to_distribute" is already distributed
step s2-commit:
COMMIT;

View File

@ -17,7 +17,7 @@ step s1-master_append_table_to_shard:
master_append_table_to_shard master_append_table_to_shard
0.0266667 0.213333
step s2-master_append_table_to_shard: step s2-master_append_table_to_shard:
SELECT SELECT
@ -33,118 +33,7 @@ step s1-commit:
step s2-master_append_table_to_shard: <... completed> step s2-master_append_table_to_shard: <... completed>
master_append_table_to_shard master_append_table_to_shard
0.0266667 0.32
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-create_distributed_table s2-create_distributed_table s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
create_distributed_table
step s2-create_distributed_table:
SELECT create_distributed_table('table_to_distribute', 'id');
<waiting ...>
step s1-commit:
COMMIT;
step s2-create_distributed_table: <... completed>
error in steps s1-commit s2-create_distributed_table: ERROR: table "table_to_distribute" is already distributed
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-master_append_table_to_shard s2-master_apply_delete_command s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-master_append_table_to_shard:
SELECT
master_append_table_to_shard(shardid, 'table_to_be_appended', 'localhost', 57636)
FROM
pg_dist_shard
WHERE
'table_to_append'::regclass::oid = logicalrelid;
master_append_table_to_shard
0.0266667
step s2-master_apply_delete_command:
SELECT master_apply_delete_command($$DELETE FROM table_to_append WHERE id >= 0$$);
ERROR: canceling statement due to user request
step s1-commit:
COMMIT;
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-master_apply_delete_command s2-master_append_table_to_shard s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-master_apply_delete_command:
SELECT master_apply_delete_command($$DELETE FROM table_to_append WHERE id >= 0$$);
master_apply_delete_command
1
step s2-master_append_table_to_shard:
SELECT
master_append_table_to_shard(shardid, 'table_to_be_appended', 'localhost', 57636)
FROM
pg_dist_shard
WHERE
'table_to_append'::regclass::oid = logicalrelid;
ERROR: canceling statement due to user request
step s1-commit:
COMMIT;
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-master_apply_delete_command s2-master_apply_delete_command s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-master_apply_delete_command:
SELECT master_apply_delete_command($$DELETE FROM table_to_append WHERE id >= 0$$);
master_apply_delete_command
1
step s2-master_apply_delete_command:
SELECT master_apply_delete_command($$DELETE FROM table_to_append WHERE id >= 0$$);
<waiting ...>
step s1-commit:
COMMIT;
step s2-master_apply_delete_command: <... completed>
master_apply_delete_command
0
step s2-commit: step s2-commit:
COMMIT; COMMIT;

View File

@ -0,0 +1,109 @@
Parsed test spec with 2 sessions
starting permutation: s1-begin s2-begin s1-master_apply_delete_command_all_shard s2-master_apply_delete_command_all_shard s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-master_apply_delete_command_all_shard:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0$$);
master_apply_delete_command
1
step s2-master_apply_delete_command_all_shard:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0$$);
<waiting ...>
step s1-commit:
COMMIT;
step s2-master_apply_delete_command_all_shard: <... completed>
master_apply_delete_command
0
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-master_apply_delete_command_all_shard s2-master_apply_delete_command_row s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-master_apply_delete_command_all_shard:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0$$);
master_apply_delete_command
1
step s2-master_apply_delete_command_row:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0 and id < 3$$);
<waiting ...>
step s1-commit:
COMMIT;
step s2-master_apply_delete_command_row: <... completed>
master_apply_delete_command
0
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-master_apply_delete_command_row s2-master_apply_delete_command_all_shard s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-master_apply_delete_command_row:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0 and id < 3$$);
master_apply_delete_command
0
step s2-master_apply_delete_command_all_shard:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0$$);
<waiting ...>
step s1-commit:
COMMIT;
step s2-master_apply_delete_command_all_shard: <... completed>
master_apply_delete_command
1
step s2-commit:
COMMIT;
starting permutation: s1-begin s2-begin s1-master_apply_delete_command_row s2-master_apply_delete_command_row s1-commit s2-commit
step s1-begin:
BEGIN;
step s2-begin:
BEGIN;
step s1-master_apply_delete_command_row:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0 and id < 3$$);
master_apply_delete_command
0
step s2-master_apply_delete_command_row:
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0 and id < 3$$);
<waiting ...>
step s1-commit:
COMMIT;
step s2-master_apply_delete_command_row: <... completed>
master_apply_delete_command
0
step s2-commit:
COMMIT;

View File

@ -23,7 +23,7 @@ test: isolation_distributed_deadlock_detection
# writes, run this test serially. # writes, run this test serially.
test: isolation_create_restore_point test: isolation_create_restore_point
test: isolation_master_append_table test: isolation_create_distributed_table isolation_master_append_table isolation_master_apply_delete
test: isolation_multi_shard_modify_vs_all test: isolation_multi_shard_modify_vs_all
test: isolation_hash_copy_vs_all test: isolation_hash_copy_vs_all
test: isolation_append_copy_vs_all test: isolation_append_copy_vs_all

View File

@ -0,0 +1,63 @@
setup
{
CREATE TABLE table_to_distribute(id int);
}
teardown
{
DROP TABLE table_to_distribute CASCADE;
}
session "s1"
step "s1-begin"
{
BEGIN;
}
step "s1-create_distributed_table"
{
SELECT create_distributed_table('table_to_distribute', 'id');
}
step "s1-copy_to_local_table"
{
COPY table_to_distribute FROM PROGRAM 'echo "0\n1\n2\n3\n4\n5\n6\n7\n8"';
}
step "s1-commit"
{
COMMIT;
}
session "s2"
step "s2-begin"
{
BEGIN;
}
step "s2-create_distributed_table"
{
SELECT create_distributed_table('table_to_distribute', 'id');
}
step "s2-copy_to_local_table"
{
COPY table_to_distribute FROM PROGRAM 'echo "0\n1\n2\n3\n4\n5\n6\n7\n8"';
}
step "s2-commit"
{
COMMIT;
}
#concurrent create_distributed_table on empty table
permutation "s1-begin" "s2-begin" "s1-create_distributed_table" "s2-create_distributed_table" "s1-commit" "s2-commit"
#concurrent create_distributed_table vs. copy to table
permutation "s1-begin" "s2-begin" "s1-create_distributed_table" "s2-copy_to_local_table" "s1-commit" "s2-commit"
permutation "s1-begin" "s2-begin" "s2-copy_to_local_table" "s1-create_distributed_table" "s2-commit" "s1-commit"
#concurrent create_distributed_table on non-empty table
permutation "s1-copy_to_local_table" "s1-begin" "s2-begin" "s1-create_distributed_table" "s2-create_distributed_table" "s1-commit" "s2-commit"

View File

@ -2,20 +2,17 @@ setup
{ {
CREATE TABLE table_to_append(id int); CREATE TABLE table_to_append(id int);
CREATE TABLE table_to_be_appended(id int); CREATE TABLE table_to_be_appended(id int);
CREATE TABLE table_to_distribute(id int);
SELECT create_distributed_table('table_to_append', 'id', 'append'); SELECT create_distributed_table('table_to_append', 'id', 'append');
INSERT INTO table_to_be_appended VALUES(1),(2),(3),(4),(5),(6); INSERT INTO table_to_be_appended SELECT generate_series(1,1000);
INSERT INTO table_to_distribute SELECT generate_series(1,100);
COPY table_to_append FROM PROGRAM 'echo "0\n7\n8\n9\n10"'; COPY table_to_append FROM PROGRAM 'echo "0\n7\n8\n9\n10000"';
} }
teardown teardown
{ {
DROP TABLE table_to_append CASCADE; DROP TABLE table_to_append CASCADE;
DROP TABLE table_to_be_appended CASCADE; DROP TABLE table_to_be_appended CASCADE;
DROP TABLE table_to_distribute CASCADE;
} }
session "s1" session "s1"
@ -25,11 +22,6 @@ step "s1-begin"
BEGIN; BEGIN;
} }
step "s1-create_distributed_table"
{
SELECT create_distributed_table('table_to_distribute', 'id');
}
step "s1-master_append_table_to_shard" step "s1-master_append_table_to_shard"
{ {
SELECT SELECT
@ -40,11 +32,6 @@ step "s1-master_append_table_to_shard"
'table_to_append'::regclass::oid = logicalrelid; 'table_to_append'::regclass::oid = logicalrelid;
} }
step "s1-master_apply_delete_command"
{
SELECT master_apply_delete_command($$DELETE FROM table_to_append WHERE id >= 0$$);
}
step "s1-commit" step "s1-commit"
{ {
COMMIT; COMMIT;
@ -57,11 +44,6 @@ step "s2-begin"
BEGIN; BEGIN;
} }
step "s2-create_distributed_table"
{
SELECT create_distributed_table('table_to_distribute', 'id');
}
step "s2-master_append_table_to_shard" step "s2-master_append_table_to_shard"
{ {
@ -73,11 +55,6 @@ step "s2-master_append_table_to_shard"
'table_to_append'::regclass::oid = logicalrelid; 'table_to_append'::regclass::oid = logicalrelid;
} }
step "s2-master_apply_delete_command"
{
SELECT master_apply_delete_command($$DELETE FROM table_to_append WHERE id >= 0$$);
}
step "s2-commit" step "s2-commit"
{ {
COMMIT; COMMIT;
@ -85,13 +62,3 @@ step "s2-commit"
# concurrent master_append_table_to_shard tests # concurrent master_append_table_to_shard tests
permutation "s1-begin" "s2-begin" "s1-master_append_table_to_shard" "s2-master_append_table_to_shard" "s1-commit" "s2-commit" permutation "s1-begin" "s2-begin" "s1-master_append_table_to_shard" "s2-master_append_table_to_shard" "s1-commit" "s2-commit"
#concurrent create_distributed_table
permutation "s1-begin" "s2-begin" "s1-create_distributed_table" "s2-create_distributed_table" "s1-commit" "s2-commit"
# concurrent master_append_table_to_shard vs master_apply_delete_command tests
permutation "s1-begin" "s2-begin" "s1-master_append_table_to_shard" "s2-master_apply_delete_command" "s1-commit" "s2-commit"
permutation "s1-begin" "s2-begin" "s1-master_apply_delete_command" "s2-master_append_table_to_shard" "s1-commit" "s2-commit"
#concurrent master_apply_delete_command vs master_apply_delete_command
permutation "s1-begin" "s2-begin" "s1-master_apply_delete_command" "s2-master_apply_delete_command" "s1-commit" "s2-commit"

View File

@ -0,0 +1,63 @@
setup
{
CREATE TABLE table_to_delete_from(id int);
SELECT create_distributed_table('table_to_delete_from', 'id', 'append');
COPY table_to_delete_from FROM PROGRAM 'echo "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10"';
}
teardown
{
DROP TABLE table_to_delete_from CASCADE;
}
session "s1"
step "s1-begin"
{
BEGIN;
}
step "s1-master_apply_delete_command_all_shard"
{
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0$$);
}
step "s1-master_apply_delete_command_row"
{
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0 and id < 3$$);
}
step "s1-commit"
{
COMMIT;
}
session "s2"
step "s2-begin"
{
BEGIN;
}
step "s2-master_apply_delete_command_all_shard"
{
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0$$);
}
step "s2-master_apply_delete_command_row"
{
SELECT master_apply_delete_command($$DELETE FROM table_to_delete_from WHERE id >= 0 and id < 3$$);
}
step "s2-commit"
{
COMMIT;
}
#concurrent master_apply_delete_command vs master_apply_delete_command
permutation "s1-begin" "s2-begin" "s1-master_apply_delete_command_all_shard" "s2-master_apply_delete_command_all_shard" "s1-commit" "s2-commit"
permutation "s1-begin" "s2-begin" "s1-master_apply_delete_command_all_shard" "s2-master_apply_delete_command_row" "s1-commit" "s2-commit"
permutation "s1-begin" "s2-begin" "s1-master_apply_delete_command_row" "s2-master_apply_delete_command_all_shard" "s1-commit" "s2-commit"
permutation "s1-begin" "s2-begin" "s1-master_apply_delete_command_row" "s2-master_apply_delete_command_row" "s1-commit" "s2-commit"