mirror of https://github.com/citusdata/citus.git
New outfiles
parent
46c8968603
commit
e6d4a11702
|
@ -937,3 +937,175 @@ nodeport|success|result
|
||||||
57638|t | 1
|
57638|t | 1
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
|
|
||||||
|
starting permutation: s1-load-cache s1-start-connection s1-lock-to-split-shard s2-print-locks s2-blocking-shard-split s2-print-locks s2-show-pg_dist_cleanup 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', 57638);
|
||||||
|
|
||||||
|
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_1500002 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[57638]::int[],
|
||||||
|
ARRAY[
|
||||||
|
'SELECT CONCAT(relation::regclass, ''-'', locktype, ''-'', mode) AS LockInfo FROM pg_locks
|
||||||
|
WHERE relation::regclass::text = ''to_split_table_1500002'';'
|
||||||
|
]::text[],
|
||||||
|
false);
|
||||||
|
|
||||||
|
node_name|node_port|success|result
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
localhost| 57638|t |to_split_table_1500002-relation-AccessShareLock
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
step s2-blocking-shard-split:
|
||||||
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
||||||
|
1500002,
|
||||||
|
ARRAY['1073741824'],
|
||||||
|
ARRAY[1, 2],
|
||||||
|
'block_writes');
|
||||||
|
|
||||||
|
citus_split_shard_by_split_points
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
step s2-print-locks:
|
||||||
|
SELECT * FROM master_run_on_worker(
|
||||||
|
ARRAY['localhost']::text[],
|
||||||
|
ARRAY[57638]::int[],
|
||||||
|
ARRAY[
|
||||||
|
'SELECT CONCAT(relation::regclass, ''-'', locktype, ''-'', mode) AS LockInfo FROM pg_locks
|
||||||
|
WHERE relation::regclass::text = ''to_split_table_1500002'';'
|
||||||
|
]::text[],
|
||||||
|
false);
|
||||||
|
|
||||||
|
node_name|node_port|success|result
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
localhost| 57638|t |to_split_table_1500002-relation-AccessShareLock
|
||||||
|
(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
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
public.to_split_table_1500002| 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-blocking-shard-split s2-print-cluster s2-show-pg_dist_cleanup s1-stop-connection
|
||||||
|
create_distributed_table
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
step s1-start-connection:
|
||||||
|
SELECT start_session_level_connection_to_node('localhost', 57638);
|
||||||
|
|
||||||
|
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_1500002 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[57638]::int[],
|
||||||
|
ARRAY[
|
||||||
|
'SELECT CONCAT(relation::regclass, ''-'', locktype, ''-'', mode) AS LockInfo FROM pg_locks
|
||||||
|
WHERE relation::regclass::text = ''to_split_table_1500002'';'
|
||||||
|
]::text[],
|
||||||
|
false);
|
||||||
|
|
||||||
|
node_name|node_port|success|result
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
localhost| 57638|t |to_split_table_1500002-relation-AccessShareLock
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
step s2-blocking-shard-split:
|
||||||
|
SELECT pg_catalog.citus_split_shard_by_split_points(
|
||||||
|
1500002,
|
||||||
|
ARRAY['1073741824'],
|
||||||
|
ARRAY[1, 2],
|
||||||
|
'block_writes');
|
||||||
|
|
||||||
|
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|1500001|t | 0
|
||||||
|
57637|1500003|t | 0
|
||||||
|
57638|1500004|t | 0
|
||||||
|
(3 rows)
|
||||||
|
|
||||||
|
id|value
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
step s2-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| 2
|
||||||
|
(1 row)
|
||||||
|
|
||||||
|
step s1-stop-connection:
|
||||||
|
SELECT stop_session_level_connection_to_node();
|
||||||
|
|
||||||
|
stop_session_level_connection_to_node
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
|
||||||
|
(1 row)
|
||||||
|
|
|
@ -773,3 +773,174 @@ id|value
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(0 rows)
|
(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 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:
|
||||||
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup;
|
||||||
|
|
||||||
|
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 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:
|
||||||
|
SELECT object_name, object_type, policy_type FROM pg_dist_cleanup;
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
Loading…
Reference in New Issue