mirror of https://github.com/citusdata/citus.git
create_distributed_table vs create_distributed_table, master_append_table_to_shard vs master_apply_delete_command, master_apply_delete_command vs master_apply_delete_command are added
parent
0722334e50
commit
636faadc47
|
@ -0,0 +1,150 @@
|
|||
Parsed test spec with 2 sessions
|
||||
|
||||
starting permutation: s1-begin s2-begin s1-master_append_table_to_shard s2-master_append_table_to_shard 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_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;
|
||||
<waiting ...>
|
||||
step s1-commit:
|
||||
COMMIT;
|
||||
|
||||
step s2-master_append_table_to_shard: <... completed>
|
||||
master_append_table_to_shard
|
||||
|
||||
0.0266667
|
||||
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:
|
||||
COMMIT;
|
||||
|
|
@ -23,6 +23,7 @@ test: isolation_distributed_deadlock_detection
|
|||
# writes, run this test serially.
|
||||
test: isolation_create_restore_point
|
||||
|
||||
test: isolation_master_append_table
|
||||
test: isolation_multi_shard_modify_vs_all
|
||||
test: isolation_hash_copy_vs_all
|
||||
test: isolation_append_copy_vs_all
|
||||
|
@ -38,4 +39,3 @@ test: isolation_delete_vs_all
|
|||
test: isolation_truncate_vs_all
|
||||
test: isolation_drop_vs_all
|
||||
test: isolation_ddl_vs_all
|
||||
test: isolation_master_append_table
|
|
@ -1,20 +1,21 @@
|
|||
setup
|
||||
{
|
||||
ALTER SEQUENCE pg_catalog.pg_dist_shardid_seq RESTART 230000;
|
||||
|
||||
CREATE TABLE table_to_append(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');
|
||||
INSERT INTO table_to_be_appended VALUES(0),(1),(2),(3),(4),(5);
|
||||
INSERT INTO table_to_be_appended VALUES(1),(2),(3),(4),(5),(6);
|
||||
INSERT INTO table_to_distribute SELECT generate_series(1,100);
|
||||
|
||||
COPY table_to_append FROM PROGRAM 'echo "1\n2\n3\n4\n5"';
|
||||
COPY table_to_append FROM PROGRAM 'echo "0\n7\n8\n9\n10"';
|
||||
}
|
||||
|
||||
teardown
|
||||
{
|
||||
DROP TABLE table_to_append CASCADE;
|
||||
DROP TABLE table_to_be_appended CASCADE;
|
||||
DROP TABLE table_to_distribute CASCADE;
|
||||
}
|
||||
|
||||
session "s1"
|
||||
|
@ -24,6 +25,11 @@ step "s1-begin"
|
|||
BEGIN;
|
||||
}
|
||||
|
||||
step "s1-create_distributed_table"
|
||||
{
|
||||
SELECT create_distributed_table('table_to_distribute', 'id');
|
||||
}
|
||||
|
||||
step "s1-master_append_table_to_shard"
|
||||
{
|
||||
SELECT
|
||||
|
@ -34,6 +40,11 @@ step "s1-master_append_table_to_shard"
|
|||
'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"
|
||||
{
|
||||
COMMIT;
|
||||
|
@ -46,6 +57,11 @@ step "s2-begin"
|
|||
BEGIN;
|
||||
}
|
||||
|
||||
step "s2-create_distributed_table"
|
||||
{
|
||||
SELECT create_distributed_table('table_to_distribute', 'id');
|
||||
}
|
||||
|
||||
step "s2-master_append_table_to_shard"
|
||||
{
|
||||
|
||||
|
@ -56,9 +72,26 @@ step "s2-master_append_table_to_shard"
|
|||
WHERE
|
||||
'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"
|
||||
{
|
||||
COMMIT;
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
||||
#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"
|
Loading…
Reference in New Issue