mirror of https://github.com/citusdata/citus.git
Fix tests
parent
7d7f9eef7a
commit
8dfd342047
|
@ -75,25 +75,6 @@ ORDER BY placementid;
|
||||||
200000 | 1
|
200000 | 1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- fail activate node by failing reference table creation
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").kill()');
|
|
||||||
mitmproxy
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT master_activate_node('localhost', :worker_2_proxy_port);
|
|
||||||
NOTICE: Replicating reference table "user_table" to the node localhost:xxxxx
|
|
||||||
ERROR: server closed the connection unexpectedly
|
|
||||||
This probably means the server terminated abnormally
|
|
||||||
before or while processing the request.
|
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
|
||||||
mitmproxy
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- verify node is not activated
|
-- verify node is not activated
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
SELECT * FROM master_get_active_worker_nodes()
|
||||||
ORDER BY 1, 2;
|
ORDER BY 1, 2;
|
||||||
|
@ -140,39 +121,6 @@ ORDER BY placementid;
|
||||||
200000 | 1
|
200000 | 1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- fail activate node by failing reference table creation
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").cancel(' || pg_backend_pid() || ')');
|
|
||||||
mitmproxy
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT master_activate_node('localhost', :worker_2_proxy_port);
|
|
||||||
NOTICE: Replicating reference table "user_table" to the node localhost:xxxxx
|
|
||||||
ERROR: canceling statement due to user request
|
|
||||||
-- verify node is not activated
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
node_name | node_port
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
localhost | 57637
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT shardid, shardstate
|
|
||||||
FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
|
||||||
ORDER BY placementid;
|
|
||||||
shardid | shardstate
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
200000 | 1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
|
||||||
mitmproxy
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- master_remove_node fails when there are shards on that worker
|
-- master_remove_node fails when there are shards on that worker
|
||||||
SELECT master_remove_node('localhost', :worker_2_proxy_port);
|
SELECT master_remove_node('localhost', :worker_2_proxy_port);
|
||||||
ERROR: you cannot remove the primary node of a node group which has shard placements
|
ERROR: you cannot remove the primary node of a node group which has shard placements
|
||||||
|
@ -225,63 +173,6 @@ ORDER BY placementid;
|
||||||
200000 | 1
|
200000 | 1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- test master_add_node replicated a reference table
|
|
||||||
-- to newly added node.
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").kill()');
|
|
||||||
mitmproxy
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
|
||||||
NOTICE: Replicating reference table "user_table" to the node localhost:xxxxx
|
|
||||||
ERROR: server closed the connection unexpectedly
|
|
||||||
This probably means the server terminated abnormally
|
|
||||||
before or while processing the request.
|
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- verify node is not added
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
node_name | node_port
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
localhost | 57637
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT shardid, shardstate
|
|
||||||
FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
|
||||||
ORDER BY placementid;
|
|
||||||
shardid | shardstate
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
200000 | 1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").cancel(' || pg_backend_pid() || ')');
|
|
||||||
mitmproxy
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
|
||||||
NOTICE: Replicating reference table "user_table" to the node localhost:xxxxx
|
|
||||||
ERROR: canceling statement due to user request
|
|
||||||
-- verify node is not added
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
node_name | node_port
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
localhost | 57637
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT shardid, shardstate
|
|
||||||
FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
|
||||||
ORDER BY placementid;
|
|
||||||
shardid | shardstate
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
200000 | 1
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
-- reset cluster to original state
|
-- reset cluster to original state
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
SELECT citus.mitmproxy('conn.allow()');
|
||||||
mitmproxy
|
mitmproxy
|
||||||
|
@ -290,10 +181,9 @@ SELECT citus.mitmproxy('conn.allow()');
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
||||||
NOTICE: Replicating reference table "user_table" to the node localhost:xxxxx
|
|
||||||
master_add_node
|
master_add_node
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
6
|
4
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- verify node is added
|
-- verify node is added
|
||||||
|
@ -312,32 +202,6 @@ ORDER BY placementid;
|
||||||
shardid | shardstate
|
shardid | shardstate
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
200000 | 1
|
200000 | 1
|
||||||
200000 | 1
|
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
-- fail master_add_node by failing copy out operation
|
|
||||||
SELECT master_remove_node('localhost', :worker_1_port);
|
|
||||||
master_remove_node
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="COPY").kill()');
|
|
||||||
mitmproxy
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT master_add_node('localhost', :worker_1_port);
|
|
||||||
NOTICE: Replicating reference table "user_table" to the node localhost:xxxxx
|
|
||||||
ERROR: could not copy table "user_table_200000" from "localhost:xxxxx"
|
|
||||||
CONTEXT: while executing command on localhost:xxxxx
|
|
||||||
-- verify node is not added
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
node_name | node_port
|
|
||||||
---------------------------------------------------------------------
|
|
||||||
localhost | 9060
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
SELECT citus.mitmproxy('conn.allow()');
|
||||||
|
@ -347,10 +211,9 @@ SELECT citus.mitmproxy('conn.allow()');
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT master_add_node('localhost', :worker_1_port);
|
SELECT master_add_node('localhost', :worker_1_port);
|
||||||
NOTICE: Replicating reference table "user_table" to the node localhost:xxxxx
|
|
||||||
master_add_node
|
master_add_node
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
8
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- verify node is added
|
-- verify node is added
|
||||||
|
@ -369,8 +232,7 @@ ORDER BY placementid;
|
||||||
shardid | shardstate
|
shardid | shardstate
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
200000 | 1
|
200000 | 1
|
||||||
200000 | 1
|
(1 row)
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
RESET SEARCH_PATH;
|
RESET SEARCH_PATH;
|
||||||
DROP SCHEMA add_remove_node CASCADE;
|
DROP SCHEMA add_remove_node CASCADE;
|
||||||
|
|
|
@ -1122,7 +1122,6 @@ ON CONFLICT(c1, c2, c3, c4, c5, c6)
|
||||||
DO UPDATE SET
|
DO UPDATE SET
|
||||||
cardinality = enriched.cardinality + excluded.cardinality,
|
cardinality = enriched.cardinality + excluded.cardinality,
|
||||||
sum = enriched.sum + excluded.sum;
|
sum = enriched.sum + excluded.sum;
|
||||||
DEBUG: rehashing catalog cache id 14 for pg_opclass; 17 tups, 8 buckets at character 224
|
|
||||||
DEBUG: INSERT target table and the source relation of the SELECT partition column value must be colocated in distributed INSERT ... SELECT
|
DEBUG: INSERT target table and the source relation of the SELECT partition column value must be colocated in distributed INSERT ... SELECT
|
||||||
DEBUG: Router planner cannot handle multi-shard select queries
|
DEBUG: Router planner cannot handle multi-shard select queries
|
||||||
DEBUG: performing repartitioned INSERT ... SELECT
|
DEBUG: performing repartitioned INSERT ... SELECT
|
||||||
|
|
|
@ -5,36 +5,34 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-copy-to-reference-table:
|
step s2-copy-to-reference-table:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
<waiting ...>
|
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s2-copy-to-reference-table: <... completed>
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 10
|
57637 t 10
|
||||||
57638 t 10
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,36 +43,34 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-copy-to-reference-table:
|
step s2-copy-to-reference-table:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
|
||||||
step s2-commit:
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
|
step s2-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 10
|
57637 t 10
|
||||||
57638 t 10
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,36 +81,34 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-insert-to-reference-table:
|
step s2-insert-to-reference-table:
|
||||||
INSERT INTO test_reference_table VALUES (6);
|
INSERT INTO test_reference_table VALUES (6);
|
||||||
<waiting ...>
|
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s2-insert-to-reference-table: <... completed>
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 6
|
57637 t 6
|
||||||
57638 t 6
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,36 +119,34 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-insert-to-reference-table:
|
step s2-insert-to-reference-table:
|
||||||
INSERT INTO test_reference_table VALUES (6);
|
INSERT INTO test_reference_table VALUES (6);
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
|
||||||
step s2-commit:
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
|
step s2-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 6
|
57637 t 6
|
||||||
57638 t 6
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -165,36 +157,35 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-ddl-on-reference-table:
|
step s2-ddl-on-reference-table:
|
||||||
CREATE INDEX reference_index ON test_reference_table(test_id);
|
CREATE INDEX reference_index ON test_reference_table(test_id);
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s2-ddl-on-reference-table: <... completed>
|
step s2-ddl-on-reference-table: <... completed>
|
||||||
step s2-print-index-count:
|
step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,36 +196,35 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-ddl-on-reference-table:
|
step s2-ddl-on-reference-table:
|
||||||
CREATE INDEX reference_index ON test_reference_table(test_id);
|
CREATE INDEX reference_index ON test_reference_table(test_id);
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s2-commit:
|
step s2-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
step s1-add-second-worker: <... completed>
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-print-index-count:
|
step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -245,19 +235,19 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s1-begin:
|
step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-create-reference-table-2:
|
step s2-create-reference-table-2:
|
||||||
SELECT create_reference_table('test_reference_table_2');
|
SELECT create_reference_table('test_reference_table_2');
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
@ -267,12 +257,12 @@ create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s2-print-content-2:
|
step s2-print-content-2:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
|
@ -288,39 +278,38 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-load-metadata-cache:
|
step s2-load-metadata-cache:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-create-reference-table-2:
|
step s2-create-reference-table-2:
|
||||||
SELECT create_reference_table('test_reference_table_2');
|
SELECT create_reference_table('test_reference_table_2');
|
||||||
|
|
||||||
create_reference_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s2-commit:
|
step s2-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
step s1-add-second-worker: <... completed>
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-print-content-2:
|
step s2-print-content-2:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -334,30 +323,28 @@ step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-copy-to-reference-table:
|
step s2-copy-to-reference-table:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
<waiting ...>
|
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s2-copy-to-reference-table: <... completed>
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 5
|
57637 t 5
|
||||||
57638 t 5
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -368,33 +355,31 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-copy-to-reference-table:
|
step s2-copy-to-reference-table:
|
||||||
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
COPY test_reference_table FROM PROGRAM 'echo 1 && echo 2 && echo 3 && echo 4 && echo 5';
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
|
||||||
step s2-commit:
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
|
step s2-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 5
|
57637 t 5
|
||||||
57638 t 5
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -408,30 +393,28 @@ step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-insert-to-reference-table:
|
step s2-insert-to-reference-table:
|
||||||
INSERT INTO test_reference_table VALUES (6);
|
INSERT INTO test_reference_table VALUES (6);
|
||||||
<waiting ...>
|
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s2-insert-to-reference-table: <... completed>
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -442,33 +425,31 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-insert-to-reference-table:
|
step s2-insert-to-reference-table:
|
||||||
INSERT INTO test_reference_table VALUES (6);
|
INSERT INTO test_reference_table VALUES (6);
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
|
||||||
step s2-commit:
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
|
step s2-commit:
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
step s2-print-content:
|
step s2-print-content:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -482,30 +463,29 @@ step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-ddl-on-reference-table:
|
step s2-ddl-on-reference-table:
|
||||||
CREATE INDEX reference_index ON test_reference_table(test_id);
|
CREATE INDEX reference_index ON test_reference_table(test_id);
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s2-ddl-on-reference-table: <... completed>
|
step s2-ddl-on-reference-table: <... completed>
|
||||||
step s2-print-index-count:
|
step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -516,33 +496,32 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-ddl-on-reference-table:
|
step s2-ddl-on-reference-table:
|
||||||
CREATE INDEX reference_index ON test_reference_table(test_id);
|
CREATE INDEX reference_index ON test_reference_table(test_id);
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s2-commit:
|
step s2-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
step s1-add-second-worker: <... completed>
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-print-index-count:
|
step s2-print-index-count:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
run_command_on_placements('test_reference_table', 'select count(*) from pg_indexes WHERE tablename = ''%s''')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
@ -556,13 +535,13 @@ step s1-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
|
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-create-reference-table-2:
|
step s2-create-reference-table-2:
|
||||||
SELECT create_reference_table('test_reference_table_2');
|
SELECT create_reference_table('test_reference_table_2');
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s1-commit:
|
step s1-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
@ -572,12 +551,12 @@ create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s2-print-content-2:
|
step s2-print-content-2:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
|
@ -593,36 +572,35 @@ create_distributed_table
|
||||||
|
|
||||||
|
|
||||||
step s2-begin:
|
step s2-begin:
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
step s2-create-reference-table-2:
|
step s2-create-reference-table-2:
|
||||||
SELECT create_reference_table('test_reference_table_2');
|
SELECT create_reference_table('test_reference_table_2');
|
||||||
|
|
||||||
create_reference_table
|
create_reference_table
|
||||||
|
|
||||||
|
|
||||||
step s1-add-second-worker:
|
step s1-add-second-worker:
|
||||||
SELECT 1 FROM master_add_node('localhost', 57638);
|
SELECT 1 FROM master_add_node('localhost', 57638);
|
||||||
<waiting ...>
|
<waiting ...>
|
||||||
step s2-commit:
|
step s2-commit:
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
step s1-add-second-worker: <... completed>
|
step s1-add-second-worker: <... completed>
|
||||||
?column?
|
?column?
|
||||||
|
|
||||||
1
|
1
|
||||||
step s2-print-content-2:
|
step s2-print-content-2:
|
||||||
SELECT
|
SELECT
|
||||||
nodeport, success, result
|
nodeport, success, result
|
||||||
FROM
|
FROM
|
||||||
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
run_command_on_placements('test_reference_table_2', 'select count(*) from %s')
|
||||||
ORDER BY
|
ORDER BY
|
||||||
nodeport;
|
nodeport;
|
||||||
|
|
||||||
nodeport success result
|
nodeport success result
|
||||||
|
|
||||||
57637 t 1
|
57637 t 1
|
||||||
57638 t 1
|
|
||||||
master_remove_node
|
master_remove_node
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,10 +15,6 @@ DEBUG: schema "citus_mx_test_schema_join_2" already exists, skipping
|
||||||
DETAIL: NOTICE from localhost:xxxxx
|
DETAIL: NOTICE from localhost:xxxxx
|
||||||
DEBUG: schema "citus_mx_schema_for_xacts" already exists, skipping
|
DEBUG: schema "citus_mx_schema_for_xacts" already exists, skipping
|
||||||
DETAIL: NOTICE from localhost:xxxxx
|
DETAIL: NOTICE from localhost:xxxxx
|
||||||
NOTICE: Replicating reference table "customer_mx" to the node localhost:xxxxx
|
|
||||||
NOTICE: Replicating reference table "nation_mx" to the node localhost:xxxxx
|
|
||||||
NOTICE: Replicating reference table "part_mx" to the node localhost:xxxxx
|
|
||||||
NOTICE: Replicating reference table "supplier_mx" to the node localhost:xxxxx
|
|
||||||
master_add_node
|
master_add_node
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
32
|
32
|
||||||
|
|
|
@ -1394,7 +1394,6 @@ WHERE logicalrelid='mx_ref'::regclass;
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SELECT master_add_node('localhost', :worker_2_port);
|
SELECT master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "mx_ref" to the node localhost:xxxxx
|
|
||||||
master_add_node
|
master_add_node
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
7
|
7
|
||||||
|
@ -1407,8 +1406,7 @@ ORDER BY shardid, nodeport;
|
||||||
shardid | nodename | nodeport
|
shardid | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1310073 | localhost | 57637
|
1310073 | localhost | 57637
|
||||||
1310073 | localhost | 57638
|
(1 row)
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
\c - - - :worker_1_port
|
\c - - - :worker_1_port
|
||||||
SELECT shardid, nodename, nodeport
|
SELECT shardid, nodename, nodeport
|
||||||
|
@ -1418,8 +1416,7 @@ ORDER BY shardid, nodeport;
|
||||||
shardid | nodename | nodeport
|
shardid | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1310073 | localhost | 57637
|
1310073 | localhost | 57637
|
||||||
1310073 | localhost | 57638
|
(1 row)
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
-- Get the metadata back into a consistent state
|
-- Get the metadata back into a consistent state
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
|
|
|
@ -173,7 +173,6 @@ SELECT nodeid, hasmetadata, metadatasynced FROM pg_dist_node;
|
||||||
-- Test updating a node when another node is in readonly-mode
|
-- Test updating a node when another node is in readonly-mode
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
SELECT master_add_node('localhost', :worker_2_port) AS nodeid_2 \gset
|
SELECT master_add_node('localhost', :worker_2_port) AS nodeid_2 \gset
|
||||||
NOTICE: Replicating reference table "ref_table" to the node localhost:xxxxx
|
|
||||||
SELECT 1 FROM start_metadata_sync_to_node('localhost', :worker_2_port);
|
SELECT 1 FROM start_metadata_sync_to_node('localhost', :worker_2_port);
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
@ -383,7 +382,6 @@ SELECT verify_metadata('localhost', :worker_1_port);
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "ref_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -449,7 +447,6 @@ SELECT wait_until_metadata_sync();
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "ref_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -511,7 +508,6 @@ SELECT wait_until_metadata_sync();
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "ref_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
|
|
@ -221,7 +221,6 @@ SELECT master_remove_node('localhost', :worker_2_port);
|
||||||
ERROR: node at "localhost:xxxxx" does not exist
|
ERROR: node at "localhost:xxxxx" does not exist
|
||||||
-- re-add the node for next tests
|
-- re-add the node for next tests
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "remove_node_reference_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -242,7 +241,6 @@ SELECT master_remove_node('localhost', :worker_2_port);
|
||||||
|
|
||||||
-- re-add the node for the next test
|
-- re-add the node for the next test
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "remove_node_reference_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -262,10 +260,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -291,10 +288,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
@ -318,10 +314,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -347,10 +342,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- remove node in a transaction and COMMIT
|
-- remove node in a transaction and COMMIT
|
||||||
|
@ -367,10 +361,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -396,10 +389,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
@ -458,7 +450,6 @@ WHERE
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- re-add the node for next tests
|
-- re-add the node for next tests
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "remove_node_reference_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -478,10 +469,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -507,10 +497,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
@ -583,7 +572,6 @@ SELECT * FROM remove_node_reference_table;
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- re-add the node for next tests
|
-- re-add the node for next tests
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "remove_node_reference_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -603,10 +591,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -632,10 +619,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
@ -704,7 +690,6 @@ SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='public.remove_
|
||||||
|
|
||||||
-- re-add the node for next tests
|
-- re-add the node for next tests
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "remove_node_reference_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -724,10 +709,9 @@ FROM
|
||||||
pg_dist_shard_placement
|
pg_dist_shard_placement
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port;
|
nodeport = :worker_2_port;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380000 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -903,8 +887,6 @@ WHERE
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- re-add the node for next tests
|
-- re-add the node for next tests
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "remove_node_reference_table" to the node localhost:xxxxx
|
|
||||||
NOTICE: Replicating reference table "table1" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -926,11 +908,9 @@ WHERE
|
||||||
nodeport = :worker_2_port
|
nodeport = :worker_2_port
|
||||||
ORDER BY
|
ORDER BY
|
||||||
shardid;
|
shardid;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380001 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
1380002 | 1 | 0 | localhost | 57638
|
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -957,11 +937,9 @@ FROM
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port
|
nodeport = :worker_2_port
|
||||||
ORDER BY shardid ASC;
|
ORDER BY shardid ASC;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1380001 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
1380002 | 1 | 0 | localhost | 57638
|
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
SELECT master_disable_node('localhost', :worker_2_port);
|
SELECT master_disable_node('localhost', :worker_2_port);
|
||||||
|
@ -1018,8 +996,6 @@ WHERE
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- re-add the node for next tests
|
-- re-add the node for next tests
|
||||||
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "remove_node_reference_table" to the node localhost:xxxxx
|
|
||||||
NOTICE: Replicating reference table "table1" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
|
|
@ -70,12 +70,16 @@ SELECT create_reference_table('replicate_reference_table_unhealthy');
|
||||||
|
|
||||||
UPDATE pg_dist_shard_placement SET shardstate = 3 WHERE shardid = 1370000;
|
UPDATE pg_dist_shard_placement SET shardstate = 3 WHERE shardid = 1370000;
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
ERROR: could not find any healthy placement for shard xxxxx
|
?column?
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
1
|
||||||
|
(1 row)
|
||||||
|
|
||||||
-- verify node is not added
|
-- verify node is not added
|
||||||
SELECT COUNT(*) FROM pg_dist_node WHERE nodeport = :worker_2_port;
|
SELECT COUNT(*) FROM pg_dist_node WHERE nodeport = :worker_2_port;
|
||||||
count
|
count
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
0
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- verify nothing is replicated to the new node
|
-- verify nothing is replicated to the new node
|
||||||
|
@ -106,9 +110,10 @@ FROM
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port
|
nodeport = :worker_2_port
|
||||||
ORDER BY shardid, nodeport;
|
ORDER BY shardid, nodeport;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(0 rows)
|
1370001 | 1 | 0 | localhost | 57638
|
||||||
|
(1 row)
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -122,7 +127,6 @@ WHERE colocationid IN
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "replicate_reference_table_valid" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -247,7 +251,6 @@ WHERE colocationid IN
|
||||||
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "replicate_reference_table_rollback" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -311,7 +314,6 @@ WHERE colocationid IN
|
||||||
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "replicate_reference_table_commit" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -326,10 +328,9 @@ FROM
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port
|
nodeport = :worker_2_port
|
||||||
ORDER BY shardid, nodeport;
|
ORDER BY shardid, nodeport;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1370003 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -406,8 +407,7 @@ ORDER BY logicalrelid;
|
||||||
replicate_reference_table_hash | h | f | c
|
replicate_reference_table_hash | h | f | c
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
BEGIN;
|
SET client_min_messages TO WARNING;
|
||||||
SET LOCAL client_min_messages TO ERROR;
|
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
|
@ -426,7 +426,7 @@ SELECT create_reference_table('replicate_reference_table_reference_two');
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
COMMIT;
|
RESET client_min_messages;
|
||||||
-- status after master_add_node
|
-- status after master_add_node
|
||||||
SELECT
|
SELECT
|
||||||
shardid, shardstate, shardlength, nodename, nodeport
|
shardid, shardstate, shardlength, nodename, nodeport
|
||||||
|
@ -554,7 +554,6 @@ WHERE colocationid IN
|
||||||
|
|
||||||
BEGIN;
|
BEGIN;
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "replicate_reference_table_drop" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -618,7 +617,6 @@ WHERE colocationid IN
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "table1" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -632,10 +630,9 @@ FROM
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port
|
nodeport = :worker_2_port
|
||||||
ORDER BY shardid, nodeport;
|
ORDER BY shardid, nodeport;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1370011 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM pg_dist_colocation
|
FROM pg_dist_colocation
|
||||||
|
@ -681,9 +678,6 @@ ORDER BY shardid, nodeport;
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "ref_table_1" to the node localhost:xxxxx
|
|
||||||
NOTICE: Replicating reference table "ref_table_2" to the node localhost:xxxxx
|
|
||||||
NOTICE: Replicating reference table "ref_table_3" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -697,19 +691,16 @@ FROM
|
||||||
WHERE
|
WHERE
|
||||||
nodeport = :worker_2_port
|
nodeport = :worker_2_port
|
||||||
ORDER BY shardid, nodeport;
|
ORDER BY shardid, nodeport;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1370012 | 1 | 0 | localhost | 57638
|
(0 rows)
|
||||||
1370013 | 1 | 0 | localhost | 57638
|
|
||||||
1370014 | 1 | 0 | localhost | 57638
|
|
||||||
(3 rows)
|
|
||||||
|
|
||||||
-- verify constraints have been created on the new node
|
-- verify constraints have been created on the new node
|
||||||
SELECT run_command_on_workers('select count(*) from pg_constraint where contype=''f'' AND conname like ''ref_table%'';');
|
SELECT run_command_on_workers('select count(*) from pg_constraint where contype=''f'' AND conname like ''ref_table%'';');
|
||||||
run_command_on_workers
|
run_command_on_workers
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
(localhost,57637,t,2)
|
(localhost,57637,t,2)
|
||||||
(localhost,57638,t,2)
|
(localhost,57638,t,0)
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
DROP TABLE ref_table_1, ref_table_2, ref_table_3;
|
DROP TABLE ref_table_1, ref_table_2, ref_table_3;
|
||||||
|
@ -754,7 +745,6 @@ ORDER BY 1,4,5;
|
||||||
|
|
||||||
-- we should see the two shard placements after activation
|
-- we should see the two shard placements after activation
|
||||||
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_activate_node('localhost', :worker_2_port);
|
||||||
NOTICE: Replicating reference table "initially_not_replicated_reference_table" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
@ -776,8 +766,7 @@ ORDER BY 1,4,5;
|
||||||
shardid | shardstate | shardlength | nodename | nodeport
|
shardid | shardstate | shardlength | nodename | nodeport
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1370015 | 1 | 0 | localhost | 57637
|
1370015 | 1 | 0 | localhost | 57637
|
||||||
1370015 | 1 | 0 | localhost | 57638
|
(1 row)
|
||||||
(2 rows)
|
|
||||||
|
|
||||||
-- this should have no effect
|
-- this should have no effect
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
|
|
|
@ -655,7 +655,6 @@ ORDER BY
|
||||||
\c - - - :master_port
|
\c - - - :master_port
|
||||||
-- try using the coordinator as a worker and then dropping the table
|
-- try using the coordinator as a worker and then dropping the table
|
||||||
SELECT 1 FROM master_add_node('localhost', :master_port);
|
SELECT 1 FROM master_add_node('localhost', :master_port);
|
||||||
NOTICE: Replicating reference table "transactional_drop_reference" to the node localhost:xxxxx
|
|
||||||
?column?
|
?column?
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
1
|
1
|
||||||
|
|
|
@ -502,7 +502,9 @@ SELECT shardid, nodename, nodeport
|
||||||
WHERE logicalrelid = 'numbers_append'::regclass order by placementid;
|
WHERE logicalrelid = 'numbers_append'::regclass order by placementid;
|
||||||
|
|
||||||
-- add the node back
|
-- add the node back
|
||||||
|
SET client_min_messages TO ERROR;
|
||||||
SELECT 1 FROM master_activate_node('localhost', :worker_1_port);
|
SELECT 1 FROM master_activate_node('localhost', :worker_1_port);
|
||||||
|
RESET client_min_messages;
|
||||||
RESET citus.shard_replication_factor;
|
RESET citus.shard_replication_factor;
|
||||||
-- add two new shards and verify they are created at both workers
|
-- add two new shards and verify they are created at both workers
|
||||||
COPY numbers_append FROM STDIN WITH (FORMAT 'csv');
|
COPY numbers_append FROM STDIN WITH (FORMAT 'csv');
|
||||||
|
|
|
@ -674,19 +674,14 @@ SELECT shardid, nodename, nodeport
|
||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
-- add the node back
|
-- add the node back
|
||||||
|
SET client_min_messages TO ERROR;
|
||||||
SELECT 1 FROM master_activate_node('localhost', :worker_1_port);
|
SELECT 1 FROM master_activate_node('localhost', :worker_1_port);
|
||||||
NOTICE: Replicating reference table "orders_reference" to the node localhost:57637
|
|
||||||
NOTICE: Replicating reference table "customer" to the node localhost:57637
|
|
||||||
NOTICE: Replicating reference table "nation" to the node localhost:57637
|
|
||||||
NOTICE: Replicating reference table "part" to the node localhost:57637
|
|
||||||
NOTICE: Replicating reference table "supplier" to the node localhost:57637
|
|
||||||
NOTICE: Replicating reference table "multi_outer_join_right_reference" to the node localhost:57637
|
|
||||||
NOTICE: Replicating reference table "multi_outer_join_third_reference" to the node localhost:57637
|
|
||||||
?column?
|
?column?
|
||||||
----------
|
----------
|
||||||
1
|
1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
RESET client_min_messages;
|
||||||
RESET citus.shard_replication_factor;
|
RESET citus.shard_replication_factor;
|
||||||
-- add two new shards and verify they are created at both workers
|
-- add two new shards and verify they are created at both workers
|
||||||
COPY numbers_append FROM STDIN WITH (FORMAT 'csv');
|
COPY numbers_append FROM STDIN WITH (FORMAT 'csv');
|
||||||
|
|
|
@ -39,13 +39,6 @@ FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
WHERE s.logicalrelid = 'user_table'::regclass
|
||||||
ORDER BY placementid;
|
ORDER BY placementid;
|
||||||
|
|
||||||
-- fail activate node by failing reference table creation
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").kill()');
|
|
||||||
|
|
||||||
SELECT master_activate_node('localhost', :worker_2_proxy_port);
|
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
|
||||||
|
|
||||||
-- verify node is not activated
|
-- verify node is not activated
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
SELECT * FROM master_get_active_worker_nodes()
|
||||||
ORDER BY 1, 2;
|
ORDER BY 1, 2;
|
||||||
|
@ -69,22 +62,6 @@ FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
WHERE s.logicalrelid = 'user_table'::regclass
|
||||||
ORDER BY placementid;
|
ORDER BY placementid;
|
||||||
|
|
||||||
-- fail activate node by failing reference table creation
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").cancel(' || pg_backend_pid() || ')');
|
|
||||||
|
|
||||||
SELECT master_activate_node('localhost', :worker_2_proxy_port);
|
|
||||||
|
|
||||||
-- verify node is not activated
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
|
|
||||||
SELECT shardid, shardstate
|
|
||||||
FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
|
||||||
ORDER BY placementid;
|
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
|
||||||
|
|
||||||
-- master_remove_node fails when there are shards on that worker
|
-- master_remove_node fails when there are shards on that worker
|
||||||
SELECT master_remove_node('localhost', :worker_2_proxy_port);
|
SELECT master_remove_node('localhost', :worker_2_proxy_port);
|
||||||
|
|
||||||
|
@ -113,34 +90,6 @@ FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
WHERE s.logicalrelid = 'user_table'::regclass
|
||||||
ORDER BY placementid;
|
ORDER BY placementid;
|
||||||
|
|
||||||
-- test master_add_node replicated a reference table
|
|
||||||
-- to newly added node.
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").kill()');
|
|
||||||
|
|
||||||
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
|
||||||
|
|
||||||
-- verify node is not added
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
|
|
||||||
SELECT shardid, shardstate
|
|
||||||
FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
|
||||||
ORDER BY placementid;
|
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="CREATE TABLE").cancel(' || pg_backend_pid() || ')');
|
|
||||||
|
|
||||||
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
|
||||||
|
|
||||||
-- verify node is not added
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
|
|
||||||
SELECT shardid, shardstate
|
|
||||||
FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
|
||||||
ORDER BY placementid;
|
|
||||||
|
|
||||||
-- reset cluster to original state
|
-- reset cluster to original state
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
SELECT citus.mitmproxy('conn.allow()');
|
||||||
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
SELECT master_add_node('localhost', :worker_2_proxy_port);
|
||||||
|
@ -154,15 +103,6 @@ FROM pg_dist_placement p JOIN pg_dist_shard s USING (shardid)
|
||||||
WHERE s.logicalrelid = 'user_table'::regclass
|
WHERE s.logicalrelid = 'user_table'::regclass
|
||||||
ORDER BY placementid;
|
ORDER BY placementid;
|
||||||
|
|
||||||
-- fail master_add_node by failing copy out operation
|
|
||||||
SELECT master_remove_node('localhost', :worker_1_port);
|
|
||||||
SELECT citus.mitmproxy('conn.onQuery(query="COPY").kill()');
|
|
||||||
SELECT master_add_node('localhost', :worker_1_port);
|
|
||||||
|
|
||||||
-- verify node is not added
|
|
||||||
SELECT * FROM master_get_active_worker_nodes()
|
|
||||||
ORDER BY 1, 2;
|
|
||||||
|
|
||||||
SELECT citus.mitmproxy('conn.allow()');
|
SELECT citus.mitmproxy('conn.allow()');
|
||||||
SELECT master_add_node('localhost', :worker_1_port);
|
SELECT master_add_node('localhost', :worker_1_port);
|
||||||
|
|
||||||
|
|
|
@ -268,12 +268,11 @@ WHERE
|
||||||
logicalrelid IN ('replicate_reference_table_reference_one', 'replicate_reference_table_hash', 'replicate_reference_table_reference_two')
|
logicalrelid IN ('replicate_reference_table_reference_one', 'replicate_reference_table_hash', 'replicate_reference_table_reference_two')
|
||||||
ORDER BY logicalrelid;
|
ORDER BY logicalrelid;
|
||||||
|
|
||||||
BEGIN;
|
SET client_min_messages TO WARNING;
|
||||||
SET LOCAL client_min_messages TO ERROR;
|
|
||||||
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
SELECT 1 FROM master_add_node('localhost', :worker_2_port);
|
||||||
SELECT upgrade_to_reference_table('replicate_reference_table_hash');
|
SELECT upgrade_to_reference_table('replicate_reference_table_hash');
|
||||||
SELECT create_reference_table('replicate_reference_table_reference_two');
|
SELECT create_reference_table('replicate_reference_table_reference_two');
|
||||||
COMMIT;
|
RESET client_min_messages;
|
||||||
|
|
||||||
-- status after master_add_node
|
-- status after master_add_node
|
||||||
SELECT
|
SELECT
|
||||||
|
|
Loading…
Reference in New Issue