mirror of https://github.com/citusdata/citus.git
1110 lines
29 KiB
Plaintext
1110 lines
29 KiB
Plaintext
unused step name: s2-select
|
|
Parsed test spec with 4 sessions
|
|
|
|
starting permutation: s1-load-cache s2-print-cluster s3-acquire-advisory-lock s1-begin s2-begin s1-non-blocking-shard-split s2-insert s2-end s2-print-cluster s3-release-advisory-lock s1-end s2-print-cluster
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-load-cache:
|
|
-- Indirect way to load cache.
|
|
TRUNCATE to_split_table;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 0
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|
|
step s3-acquire-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-begin:
|
|
BEGIN;
|
|
|
|
step s2-begin:
|
|
BEGIN;
|
|
|
|
step s1-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[2, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s2-insert:
|
|
SELECT get_shard_id_for_distribution_column('to_split_table', 123456789);
|
|
INSERT INTO to_split_table VALUES (123456789, 1);
|
|
|
|
get_shard_id_for_distribution_column
|
|
---------------------------------------------------------------------
|
|
1500001
|
|
(1 row)
|
|
|
|
step s2-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 1
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
step s3-release-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s1-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57638|1500002|t | 0
|
|
57638|1500003|t | 1
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
|
|
starting permutation: s1-load-cache s2-insert s2-print-cluster s3-acquire-advisory-lock s1-begin s1-non-blocking-shard-split s2-update s3-release-advisory-lock s1-end s2-print-cluster
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-load-cache:
|
|
-- Indirect way to load cache.
|
|
TRUNCATE to_split_table;
|
|
|
|
step s2-insert:
|
|
SELECT get_shard_id_for_distribution_column('to_split_table', 123456789);
|
|
INSERT INTO to_split_table VALUES (123456789, 1);
|
|
|
|
get_shard_id_for_distribution_column
|
|
---------------------------------------------------------------------
|
|
1500001
|
|
(1 row)
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 1
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
step s3-acquire-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-begin:
|
|
BEGIN;
|
|
|
|
step s1-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[2, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s2-update:
|
|
UPDATE to_split_table SET value = 111 WHERE id = 123456789;
|
|
|
|
step s3-release-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s1-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57638|1500002|t | 0
|
|
57638|1500003|t | 1
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 111
|
|
(1 row)
|
|
|
|
|
|
starting permutation: s1-load-cache s2-insert s2-print-cluster s3-acquire-advisory-lock s1-begin s1-non-blocking-shard-split s2-delete s3-release-advisory-lock s1-end s2-print-cluster
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-load-cache:
|
|
-- Indirect way to load cache.
|
|
TRUNCATE to_split_table;
|
|
|
|
step s2-insert:
|
|
SELECT get_shard_id_for_distribution_column('to_split_table', 123456789);
|
|
INSERT INTO to_split_table VALUES (123456789, 1);
|
|
|
|
get_shard_id_for_distribution_column
|
|
---------------------------------------------------------------------
|
|
1500001
|
|
(1 row)
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 1
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
step s3-acquire-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-begin:
|
|
BEGIN;
|
|
|
|
step s1-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[2, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s2-delete:
|
|
DELETE FROM to_split_table WHERE id = 123456789;
|
|
|
|
step s3-release-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s1-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57638|1500002|t | 0
|
|
57638|1500003|t | 0
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|
|
|
|
starting permutation: s1-load-cache s2-print-cluster s3-acquire-advisory-lock s1-begin s2-begin s1-non-blocking-shard-split s2-insert s2-end s2-print-cluster s4-begin s3-release-advisory-lock s4-insert s1-end s4-end s2-print-cluster
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-load-cache:
|
|
-- Indirect way to load cache.
|
|
TRUNCATE to_split_table;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 0
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|
|
step s3-acquire-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-begin:
|
|
BEGIN;
|
|
|
|
step s2-begin:
|
|
BEGIN;
|
|
|
|
step s1-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[2, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s2-insert:
|
|
SELECT get_shard_id_for_distribution_column('to_split_table', 123456789);
|
|
INSERT INTO to_split_table VALUES (123456789, 1);
|
|
|
|
get_shard_id_for_distribution_column
|
|
---------------------------------------------------------------------
|
|
1500001
|
|
(1 row)
|
|
|
|
step s2-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 1
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
step s4-begin:
|
|
BEGIN;
|
|
|
|
step s3-release-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s1-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s4-insert:
|
|
INSERT INTO to_split_table VALUES (900, 1);
|
|
<waiting ...>
|
|
step s1-end:
|
|
COMMIT;
|
|
|
|
step s4-insert: <... completed>
|
|
step s4-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57638|1500002|t | 0
|
|
57638|1500003|t | 2
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
900| 1
|
|
123456789| 1
|
|
(2 rows)
|
|
|
|
|
|
starting permutation: s2-print-cluster s3-acquire-advisory-lock s1-begin s2-begin s1-non-blocking-shard-split s2-insert s2-end s2-print-cluster s3-release-advisory-lock s1-end s2-print-cluster
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 0
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|
|
step s3-acquire-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-begin:
|
|
BEGIN;
|
|
|
|
step s2-begin:
|
|
BEGIN;
|
|
|
|
step s1-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[2, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s2-insert:
|
|
SELECT get_shard_id_for_distribution_column('to_split_table', 123456789);
|
|
INSERT INTO to_split_table VALUES (123456789, 1);
|
|
|
|
get_shard_id_for_distribution_column
|
|
---------------------------------------------------------------------
|
|
1500001
|
|
(1 row)
|
|
|
|
step s2-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 1
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
step s3-release-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s1-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57638|1500002|t | 0
|
|
57638|1500003|t | 1
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
|
|
starting permutation: s2-insert s2-print-cluster s3-acquire-advisory-lock s1-begin s1-non-blocking-shard-split s2-update s3-release-advisory-lock s1-end s2-print-cluster
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-insert:
|
|
SELECT get_shard_id_for_distribution_column('to_split_table', 123456789);
|
|
INSERT INTO to_split_table VALUES (123456789, 1);
|
|
|
|
get_shard_id_for_distribution_column
|
|
---------------------------------------------------------------------
|
|
1500001
|
|
(1 row)
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 1
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
step s3-acquire-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-begin:
|
|
BEGIN;
|
|
|
|
step s1-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[2, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s2-update:
|
|
UPDATE to_split_table SET value = 111 WHERE id = 123456789;
|
|
|
|
step s3-release-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s1-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57638|1500002|t | 0
|
|
57638|1500003|t | 1
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 111
|
|
(1 row)
|
|
|
|
|
|
starting permutation: s2-insert s2-print-cluster s3-acquire-advisory-lock s1-begin s1-non-blocking-shard-split s2-delete s3-release-advisory-lock s1-end s2-print-cluster
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-insert:
|
|
SELECT get_shard_id_for_distribution_column('to_split_table', 123456789);
|
|
INSERT INTO to_split_table VALUES (123456789, 1);
|
|
|
|
get_shard_id_for_distribution_column
|
|
---------------------------------------------------------------------
|
|
1500001
|
|
(1 row)
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500001|t | 1
|
|
(1 row)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
123456789| 1
|
|
(1 row)
|
|
|
|
step s3-acquire-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-begin:
|
|
BEGIN;
|
|
|
|
step s1-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[2, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s2-delete:
|
|
DELETE FROM to_split_table WHERE id = 123456789;
|
|
|
|
step s3-release-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s1-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-end:
|
|
COMMIT;
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57638|1500002|t | 0
|
|
57638|1500003|t | 0
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|
|
|
|
starting permutation: s1-load-cache s1-start-connection s1-lock-to-split-shard s2-print-locks s2-non-blocking-shard-split s2-print-locks s2-show-pg_dist_cleanup-shards s1-stop-connection
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-load-cache:
|
|
-- Indirect way to load cache.
|
|
TRUNCATE to_split_table;
|
|
|
|
step s1-start-connection:
|
|
SELECT start_session_level_connection_to_node('localhost', 57637);
|
|
|
|
start_session_level_connection_to_node
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-lock-to-split-shard:
|
|
SELECT run_commands_on_session_level_connection_to_node('BEGIN; LOCK TABLE to_split_table_1500001 IN ACCESS SHARE MODE;');
|
|
|
|
run_commands_on_session_level_connection_to_node
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-print-locks:
|
|
SELECT * FROM master_run_on_worker(
|
|
ARRAY['localhost']::text[],
|
|
ARRAY[57637]::int[],
|
|
ARRAY[
|
|
'SELECT CONCAT(relation::regclass, ''-'', locktype, ''-'', mode) AS LockInfo FROM pg_locks
|
|
WHERE relation::regclass::text = ''to_split_table_1500001'';'
|
|
]::text[],
|
|
false);
|
|
|
|
node_name|node_port|success|result
|
|
---------------------------------------------------------------------
|
|
localhost| 57637|t |to_split_table_1500001-relation-AccessShareLock
|
|
(1 row)
|
|
|
|
step s2-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[1, 2],
|
|
'force_logical');
|
|
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-print-locks:
|
|
SELECT * FROM master_run_on_worker(
|
|
ARRAY['localhost']::text[],
|
|
ARRAY[57637]::int[],
|
|
ARRAY[
|
|
'SELECT CONCAT(relation::regclass, ''-'', locktype, ''-'', mode) AS LockInfo FROM pg_locks
|
|
WHERE relation::regclass::text = ''to_split_table_1500001'';'
|
|
]::text[],
|
|
false);
|
|
|
|
node_name|node_port|success|result
|
|
---------------------------------------------------------------------
|
|
localhost| 57637|t |to_split_table_1500001-relation-AccessShareLock
|
|
(1 row)
|
|
|
|
step s2-show-pg_dist_cleanup-shards:
|
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup
|
|
WHERE object_type = 1;
|
|
|
|
object_name |object_type|policy_type
|
|
---------------------------------------------------------------------
|
|
public.to_split_table_1500001| 1| 2
|
|
(1 row)
|
|
|
|
step s1-stop-connection:
|
|
SELECT stop_session_level_connection_to_node();
|
|
|
|
stop_session_level_connection_to_node
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
|
|
starting permutation: s1-start-connection s1-lock-to-split-shard s2-print-locks s2-non-blocking-shard-split s2-print-cluster s2-show-pg_dist_cleanup-shards s1-stop-connection
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-start-connection:
|
|
SELECT start_session_level_connection_to_node('localhost', 57637);
|
|
|
|
start_session_level_connection_to_node
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-lock-to-split-shard:
|
|
SELECT run_commands_on_session_level_connection_to_node('BEGIN; LOCK TABLE to_split_table_1500001 IN ACCESS SHARE MODE;');
|
|
|
|
run_commands_on_session_level_connection_to_node
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-print-locks:
|
|
SELECT * FROM master_run_on_worker(
|
|
ARRAY['localhost']::text[],
|
|
ARRAY[57637]::int[],
|
|
ARRAY[
|
|
'SELECT CONCAT(relation::regclass, ''-'', locktype, ''-'', mode) AS LockInfo FROM pg_locks
|
|
WHERE relation::regclass::text = ''to_split_table_1500001'';'
|
|
]::text[],
|
|
false);
|
|
|
|
node_name|node_port|success|result
|
|
---------------------------------------------------------------------
|
|
localhost| 57637|t |to_split_table_1500001-relation-AccessShareLock
|
|
(1 row)
|
|
|
|
step s2-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[1, 2],
|
|
'force_logical');
|
|
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-print-cluster:
|
|
-- row count per shard
|
|
SELECT
|
|
nodeport, shardid, success, result
|
|
FROM
|
|
run_command_on_placements('to_split_table', 'select count(*) from %s')
|
|
ORDER BY
|
|
nodeport, shardid;
|
|
-- rows
|
|
SELECT id, value FROM to_split_table ORDER BY id, value;
|
|
|
|
nodeport|shardid|success|result
|
|
---------------------------------------------------------------------
|
|
57637|1500002|t | 0
|
|
57638|1500003|t | 0
|
|
(2 rows)
|
|
|
|
id|value
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|
|
step s2-show-pg_dist_cleanup-shards:
|
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup
|
|
WHERE object_type = 1;
|
|
|
|
object_name |object_type|policy_type
|
|
---------------------------------------------------------------------
|
|
public.to_split_table_1500001| 1| 2
|
|
(1 row)
|
|
|
|
step s1-stop-connection:
|
|
SELECT stop_session_level_connection_to_node();
|
|
|
|
stop_session_level_connection_to_node
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
|
|
starting permutation: s1-load-cache s1-acquire-split-advisory-lock s2-non-blocking-shard-split s1-run-cleaner s1-show-pg_dist_cleanup s1-release-split-advisory-lock s1-run-cleaner s2-show-pg_dist_cleanup
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-load-cache:
|
|
-- Indirect way to load cache.
|
|
TRUNCATE to_split_table;
|
|
|
|
step s1-acquire-split-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[1, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s1-run-cleaner:
|
|
SELECT run_try_drop_marked_resources();
|
|
|
|
run_try_drop_marked_resources
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-show-pg_dist_cleanup:
|
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup;
|
|
|
|
object_name |object_type|policy_type
|
|
---------------------------------------------------------------------
|
|
public.to_split_table_1500002 | 1| 1
|
|
public.to_split_table_1500003 | 1| 1
|
|
public.to_split_table_1500001 | 1| 0
|
|
public.to_split_table_1500003 | 1| 0
|
|
citus_shard_split_publication_xxxxxxx_xxxxxxx_xxxxxxx | 4| 0
|
|
citus_shard_split_publication_xxxxxxx_xxxxxxx_xxxxxxx | 4| 0
|
|
citus_shard_split_slot_xxxxxxx_xxxxxxx_xxxxxxx | 3| 0
|
|
citus_shard_split_slot_xxxxxxx_xxxxxxx_xxxxxxx | 3| 0
|
|
citus_shard_split_subscription_role_xxxxxxx_xxxxxxx| 5| 0
|
|
citus_shard_split_subscription_xxxxxxx_xxxxxxx | 2| 0
|
|
citus_shard_split_subscription_role_xxxxxxx_xxxxxxx| 5| 0
|
|
citus_shard_split_subscription_xxxxxxx_xxxxxxx | 2| 0
|
|
(12 rows)
|
|
|
|
step s1-release-split-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s2-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-run-cleaner:
|
|
SELECT run_try_drop_marked_resources();
|
|
|
|
run_try_drop_marked_resources
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-show-pg_dist_cleanup:
|
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup;
|
|
|
|
object_name|object_type|policy_type
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|
|
|
|
starting permutation: s1-acquire-split-advisory-lock s2-non-blocking-shard-split s1-run-cleaner s1-show-pg_dist_cleanup s1-release-split-advisory-lock s1-run-cleaner s2-show-pg_dist_cleanup
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-acquire-split-advisory-lock:
|
|
SELECT pg_advisory_lock(44000, 55152);
|
|
|
|
pg_advisory_lock
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-non-blocking-shard-split:
|
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
|
1500001,
|
|
ARRAY['-1073741824'],
|
|
ARRAY[1, 2],
|
|
'force_logical');
|
|
<waiting ...>
|
|
step s1-run-cleaner:
|
|
SELECT run_try_drop_marked_resources();
|
|
|
|
run_try_drop_marked_resources
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-show-pg_dist_cleanup:
|
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup;
|
|
|
|
object_name |object_type|policy_type
|
|
---------------------------------------------------------------------
|
|
public.to_split_table_1500002 | 1| 1
|
|
public.to_split_table_1500003 | 1| 1
|
|
public.to_split_table_1500001 | 1| 0
|
|
public.to_split_table_1500003 | 1| 0
|
|
citus_shard_split_publication_xxxxxxx_xxxxxxx_xxxxxxx | 4| 0
|
|
citus_shard_split_publication_xxxxxxx_xxxxxxx_xxxxxxx | 4| 0
|
|
citus_shard_split_slot_xxxxxxx_xxxxxxx_xxxxxxx | 3| 0
|
|
citus_shard_split_slot_xxxxxxx_xxxxxxx_xxxxxxx | 3| 0
|
|
citus_shard_split_subscription_role_xxxxxxx_xxxxxxx| 5| 0
|
|
citus_shard_split_subscription_xxxxxxx_xxxxxxx | 2| 0
|
|
citus_shard_split_subscription_role_xxxxxxx_xxxxxxx| 5| 0
|
|
citus_shard_split_subscription_xxxxxxx_xxxxxxx | 2| 0
|
|
(12 rows)
|
|
|
|
step s1-release-split-advisory-lock:
|
|
SELECT pg_advisory_unlock(44000, 55152);
|
|
|
|
pg_advisory_unlock
|
|
---------------------------------------------------------------------
|
|
t
|
|
(1 row)
|
|
|
|
step s2-non-blocking-shard-split: <... completed>
|
|
citus_split_shard_by_split_points
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s1-run-cleaner:
|
|
SELECT run_try_drop_marked_resources();
|
|
|
|
run_try_drop_marked_resources
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
step s2-show-pg_dist_cleanup:
|
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup;
|
|
|
|
object_name|object_type|policy_type
|
|
---------------------------------------------------------------------
|
|
(0 rows)
|
|
|