Adds public host parameters

pull/3546/head
Halil Ozan Akgul 2020-02-27 11:22:34 +03:00
parent 4b9705f714
commit c2edf989cf
3 changed files with 28 additions and 21 deletions

View File

@ -112,7 +112,7 @@ check-empty: all
-- $(MULTI_REGRESS_OPTS) $(EXTRA_TESTS)
check-multi: all
$(pg_regress_multi_check) --constr="$(constr)" --load-extension=citus \
$(pg_regress_multi_check) --constr="$(constr)" --hoststr="$(hoststr)" --load-extension=citus \
-- $(MULTI_REGRESS_OPTS) --schedule=$(citus_abs_srcdir)/multi_schedule $(EXTRA_TESTS)
check-multi-vg: all

View File

@ -81,6 +81,8 @@ my $connectionTimeout = 5000;
my $useMitmproxy = 0;
my $mitmFifoPath = catfile($TMP_CHECKDIR, "mitmproxy.fifo");
my $conninfo = "";
my $publicWorker1Host = "localhost";
my $publicWorker2Host = "localhost";
my $serversAreShutdown = "TRUE";
my $usingWindows = 0;
@ -110,6 +112,8 @@ GetOptions(
'connection-timeout=s' => \$connectionTimeout,
'mitmproxy' => \$useMitmproxy,
'conninfo=s' => \$conninfo,
'worker-1-public-hostname=s' => \$publicWorker1Host,
'worker-2-public-hostname=s' => \$publicWorker2Host,
'help' => sub { Usage() });
# Update environment to include [DY]LD_LIBRARY_PATH/LIBDIR/etc -
@ -553,6 +557,9 @@ for my $workeroff (0 .. $#workerHosts)
my $host = $workerHosts[$workeroff];
print $fh "--variable=worker_".($workeroff+1)."_host=\"$host\" ";
}
print $fh "--variable=master_host=\"$host\" ";
print $fh "--variable=public_worker_1_host=\"$publicWorker1Host\" ";
print $fh "--variable=public_worker_2_host=\"$publicWorker2Host\" ";
for my $workeroff (0 .. $#followerWorkerPorts)
{
my $port = $followerWorkerPorts[$workeroff];

View File

@ -290,9 +290,9 @@ DROP TABLE data_load_test1, data_load_test2;
END;
-- There should be no table on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT relname FROM pg_class WHERE relname LIKE 'data_load_test%';
\c - - - :master_port
\c - - :master_host :master_port
-- creating an index after loading data works
BEGIN;
@ -348,9 +348,9 @@ CREATE UNLOGGED TABLE unlogged_table
SELECT create_distributed_table('unlogged_table', 'key');
SELECT * FROM master_get_table_ddl_events('unlogged_table');
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT relpersistence FROM pg_class WHERE relname LIKE 'unlogged_table_%';
\c - - - :master_port
\c - - :master_host :master_port
-- Test rollback of create table
BEGIN;
@ -359,9 +359,9 @@ SELECT create_distributed_table('rollback_table','id');
ROLLBACK;
-- Table should not exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid FROM pg_class WHERE relname LIKE 'rollback_table%');
\c - - - :master_port
\c - - :master_host :master_port
-- Insert 3 rows to make sure that copy after shard creation touches the same
-- worker node twice.
@ -374,9 +374,9 @@ SELECT create_distributed_table('rollback_table','id');
ROLLBACK;
-- Table should not exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid FROM pg_class WHERE relname LIKE 'rollback_table%');
\c - - - :master_port
\c - - :master_host :master_port
BEGIN;
CREATE TABLE rollback_table(id int, name varchar(20));
@ -404,9 +404,9 @@ SELECT create_distributed_table('rollback_table','id');
ROLLBACK;
-- Table should not exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid FROM pg_class WHERE relname LIKE 'rollback_table%');
\c - - - :master_port
\c - - :master_host :master_port
BEGIN;
CREATE TABLE tt1(id int);
@ -418,10 +418,10 @@ INSERT INTO tt2 SELECT * FROM tt1 WHERE id = 1;
COMMIT;
-- Table should exist on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.tt1_360069'::regclass;
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.tt2_360073'::regclass;
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE tt1;
DROP TABLE tt2;
@ -435,14 +435,14 @@ SELECT master_create_empty_shard('append_tt1');
ROLLBACK;
-- Table exists on the worker node.
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.append_tt1_360077'::regclass;
\c - - - :master_port
\c - - :master_host :master_port
-- There should be no table on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid from pg_class WHERE relname LIKE 'public.tt1%');
\c - - - :master_port
\c - - :master_host :master_port
-- Queries executing with router executor is allowed in the same transaction
-- with create_distributed_table
@ -455,9 +455,9 @@ SELECT * FROM tt1 WHERE id = 1;
COMMIT;
-- Placements should be created on the worker
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = 'public.tt1_360078'::regclass;
\c - - - :master_port
\c - - :master_host :master_port
DROP TABLE tt1;
@ -468,9 +468,9 @@ DROP TABLE tt1;
COMMIT;
-- There should be no table on the worker node
\c - - - :worker_1_port
\c - - :public_worker_1_host :worker_1_port
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid = (SELECT oid from pg_class WHERE relname LIKE 'tt1%');
\c - - - :master_port
\c - - :master_host :master_port
-- Tests with create_distributed_table & DDL & DML commands