Commit 42908dc5 authored by Julius Goryavsky's avatar Julius Goryavsky

MDEV-26171: wsrep_sst_receive_address does not parse IPv6 address correctly

This commit fixes problems with parsing ipv6 addresses given via
the wsrep_sst_receive_address and wsrep_node_address options.

Also, this commit removes extra lines in the configuration files
in the mtr test suites for Galera related to these parameters.
parent d31732e0
......@@ -7,18 +7,18 @@ binlog-format=row
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
# enforce read-committed characteristics across the cluster
wsrep-sync-wait=15
wsrep-on=1
[mysqld.1]
loose-innodb
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep-cluster-address=gcomm://
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
......@@ -31,23 +31,19 @@ loose-innodb
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
# enforce read-committed characteristics across the cluster
wsrep_causal_reads=ON
wsrep_sync_wait = 15
wsrep_node_address=127.0.0.1
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
[ENV]
NODE_MYPORT_1= @mysqld.1.port
NODE_MYSOCK_1= @mysqld.1.socket
NODE_MYPORT_2= @mysqld.2.port
NODE_MYSOCK_2= @mysqld.2.socket
......@@ -25,7 +25,7 @@ wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
wsrep_cluster_address=gcomm://
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
wsrep_node_address=127.0.0.1
wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
# enforce read-committed characteristics across the cluster
wsrep-causal-reads=ON
......@@ -44,7 +44,7 @@ wsrep_provider=@ENV.WSREP_PROVIDER
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
wsrep_node_address=127.0.0.1
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
# enforce read-committed characteristics across the cluster
wsrep-causal-reads=ON
......@@ -62,9 +62,3 @@ NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
......@@ -25,9 +25,9 @@ log-slave-updates
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
......@@ -49,9 +49,9 @@ log-slave-updates
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
......@@ -69,9 +69,3 @@ NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
......@@ -23,9 +23,9 @@ wsrep-on=1
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.install_timeout = PT15S;evs.max_install_timeouts=1;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
......@@ -45,9 +45,9 @@ wsrep-on=1
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.install_timeout=PT15S;evs.max_install_timeouts=1;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
......@@ -67,9 +67,9 @@ wsrep-on=1
innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port'
wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.install_timeout=PT15S;evs.max_install_timeouts=1;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
......@@ -90,11 +90,3 @@ NODE_MYSOCK_3= @mysqld.3.socket
NODE_MYPORT_4= @mysqld.4.port
NODE_MYSOCK_4= @mysqld.4.socket
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_GALERAPORT_4= @mysqld.4.#galera_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
NODE_SSTPORT_4= @mysqld.4.#sst_port
......@@ -7,7 +7,6 @@ innodb-autoinc-lock-mode=2
default-storage-engine=innodb
wsrep-on=1
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
# enforce read-committed characteristics across the cluster
wsrep-causal-reads=ON
wsrep-sync-wait=15
......@@ -16,9 +15,9 @@ wsrep-sync-wait=15
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
......@@ -26,31 +25,29 @@ wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
[mysqld.3]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
[mysqld.4]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-on=1
wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.4.#galera_port;gcache.size=10M'
wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
......@@ -66,13 +63,3 @@ NODE_MYSOCK_3= @mysqld.3.socket
NODE_MYPORT_4= @mysqld.4.port
NODE_MYSOCK_4= @mysqld.4.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_GALERAPORT_4= @mysqld.4.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
NODE_SSTPORT_4= @mysqld.4.#sst_port
--- r/galera_sst_mariabackup_logarachive.result
+++ r/galera_sst_mariabackup_logarachive.reject
--- r/galera_sst_mariabackup_logarchive.result
+++ r/galera_sst_mariabackup_logarchive.reject
@@ -286,5 +286,113 @@
DROP TABLE t1;
COMMIT;
......
--- galera_sst_rsync_recv_auto.result
+++ galera_sst_rsync_recv_auto.reject
@@ -286,3 +286,111 @@
DROP TABLE t1;
COMMIT;
SET AUTOCOMMIT=ON;
+Performing State Transfer on a server that has been killed and restarted
+while a DDL was in progress on it
+connection node_1;
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+connection node_2;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+SET GLOBAL debug_dbug = 'd,sync.alter_opened_table';
+connection node_1;
+ALTER TABLE t1 ADD COLUMN f2 INTEGER;
+connection node_2;
+SET wsrep_sync_wait = 0;
+Killing server ...
+connection node_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+INSERT INTO t1 (f1) VALUES ('node1_committed_during');
+COMMIT;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+connection node_2;
+Performing --wsrep-recover ...
+connection node_2;
+Starting server ...
+Using --wsrep-start-position when starting mysqld ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+INSERT INTO t1 (f1) VALUES ('node2_committed_after');
+COMMIT;
+connection node_1;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after');
+COMMIT;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+INSERT INTO t1 (f1) VALUES ('node1_committed_after');
+COMMIT;
+connection node_1a_galera_st_kill_slave_ddl;
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after');
+ROLLBACK;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+COMMIT;
+SET AUTOCOMMIT=ON;
+connection node_1;
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
+COUNT(*) = 2
+1
+SELECT COUNT(*) = 35 FROM t1;
+COUNT(*) = 35
+1
+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1;
+COUNT(*) = 0
+1
+DROP TABLE t1;
+COMMIT;
+SET AUTOCOMMIT=ON;
+SET GLOBAL debug_dbug = $debug_orig;
This diff is collapsed.
......@@ -44,7 +44,7 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://.*\\) failed: 7");
disconnect node_2;
disconnect node_1;
# End of test
!include ../galera_2nodes.cnf
[mysqld]
wsrep_sst_method=rsync
bind-address=::
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port;gcache.size=1;pc.ignore_sb=true'
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_address=::1
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port;gcache.size=1;pc.ignore_sb=true'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_sst_receive_address=AUTO
--source include/big_test.inc
--source include/galera_cluster.inc
--source include/check_ipv6.inc
--let $node_1=node_1
--let $node_2=node_2
--source include/auto_increment_offset_save.inc
--source suite/galera/include/galera_st_shutdown_slave.inc
--source suite/galera/include/galera_st_clean_slave.inc
--source suite/galera/include/galera_st_kill_slave.inc
--source suite/galera/include/galera_st_kill_slave_ddl.inc
--source include/auto_increment_offset_restore.inc
......@@ -68,7 +68,7 @@ CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed t
CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)");
CALL mtr.add_suppression("gcs connect failed: Connection timed out");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(foo://\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7");
CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://.*\\) failed: 7");
# Restore original auto_increment_offset values.
--source include/auto_increment_offset_restore.inc
......
......@@ -13,7 +13,6 @@ auto_increment_increment=3
wsrep-on=1
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
# enforce read-committed characteristics across the cluster
# wsrep-causal-reads=ON
# wsrep-sync-wait=15
......@@ -26,9 +25,9 @@ wsrep-cluster-address='gcomm://'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
wsrep-on=1
[mysqld.2]
#galera_port=@OPT.port
......@@ -38,9 +37,9 @@ wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
wsrep-on=1
[mysqld.3]
#galera_port=@OPT.port
......@@ -50,10 +49,9 @@ wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
wsrep-on=1
[mysqld.4]
wsrep_cluster_name=cluster2
......@@ -65,9 +63,9 @@ wsrep-cluster-address='gcomm://'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.4.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
wsrep-on=1
[mysqld.5]
wsrep_cluster_name=cluster2
......@@ -78,9 +76,9 @@ wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.5.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.5.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.5.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.5.#sst_port'
wsrep-on=1
[mysqld.6]
wsrep_cluster_name=cluster2
......@@ -91,9 +89,9 @@ wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.6.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.6.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.6.#sst_port'
wsrep-on=1
[ENV]
NODE_MYPORT_1= @mysqld.1.port
......@@ -113,17 +111,3 @@ NODE_MYSOCK_5= @mysqld.5.socket
NODE_MYPORT_6= @mysqld.6.port
NODE_MYSOCK_6= @mysqld.6.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_GALERAPORT_4= @mysqld.4.#galera_port
NODE_GALERAPORT_5= @mysqld.5.#galera_port
NODE_GALERAPORT_6= @mysqld.6.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
NODE_SSTPORT_4= @mysqld.4.#sst_port
NODE_SSTPORT_5= @mysqld.5.#sst_port
NODE_SSTPORT_6= @mysqld.6.#sst_port
......@@ -9,7 +9,6 @@ auto_increment_increment=3
wsrep-on=1
wsrep-provider=@ENV.WSREP_PROVIDER
wsrep_node_address=127.0.0.1
# enforce read-committed characteristics across the cluster
wsrep-causal-reads=ON
wsrep-sync-wait=15
......@@ -22,6 +21,7 @@ wsrep-cluster-address='gcomm://'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.1.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
......@@ -33,6 +33,7 @@ wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.2.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
......@@ -44,6 +45,7 @@ wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
wsrep_node_address='127.0.0.1:@mysqld.3.#galera_port'
wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
......@@ -56,12 +58,3 @@ NODE_MYSOCK_2= @mysqld.2.socket
NODE_MYPORT_3= @mysqld.3.port
NODE_MYSOCK_3= @mysqld.3.socket
NODE_GALERAPORT_1= @mysqld.1.#galera_port
NODE_GALERAPORT_2= @mysqld.2.#galera_port
NODE_GALERAPORT_3= @mysqld.3.#galera_port
NODE_SSTPORT_1= @mysqld.1.#sst_port
NODE_SSTPORT_2= @mysqld.2.#sst_port
NODE_SSTPORT_3= @mysqld.3.#sst_port
......@@ -3,33 +3,33 @@
[mysqld]
wsrep_sst_method=mariabackup
wsrep_sst_auth="root:"
wsrep_node_address=::1
bind-address=::
[mysqld.1]
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_name=node_1
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_node_name=node_2
wsrep_sst_donor=node_1
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
wsrep_node_name=node_3
wsrep_sst_donor=node_1
bind-address=::
[SST]
transferfmt=@ENV.MTR_GALERA_TFMT
......
......@@ -7,33 +7,33 @@ bind-address=::
innodb-data-home-dir=
wsrep_sst_method=mariabackup
wsrep_sst_auth="root:"
wsrep_node_address=::1
bind-address=::
[mysqld.1]
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
wsrep_node_name=node_1
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
wsrep_node_name=node_2
wsrep_sst_donor=node_1
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
wsrep_node_name=node_3
wsrep_sst_donor=node_1
bind-address=::
[SST]
transferfmt=@ENV.MTR_GALERA_TFMT
......
......@@ -2,25 +2,25 @@
[mysqld]
wsrep_sst_method=rsync
wsrep_node_address=::1
bind-address=::
[mysqld.1]
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
......@@ -2,25 +2,25 @@
[mysqld]
wsrep_sst_method=rsync
wsrep_node_address=::1
bind-address=::
[mysqld.1]
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
......@@ -7,25 +7,25 @@ innodb-data-home-dir=/tmp
[mysqld]
innodb-data-home-dir=
wsrep_sst_method=rsync
wsrep_node_address=::1
bind-address=::
[mysqld.1]
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_host=[::1];base_port=@mysqld.1.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.1.#galera_port;ist.recv_addr=[::1]:@mysqld.1.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.1.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.1.port'
bind-address=::
[mysqld.2]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.2.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.2.#galera_port;ist.recv_addr=[::1]:@mysqld.2.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.2.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.2.port'
bind-address=::
[mysqld.3]
wsrep_cluster_address='gcomm://[::1]:@mysqld.1.#galera_port'
wsrep_provider_options='base_host=[::1];base_port=@mysqld.3.#galera_port;gmcast.listen_addr=tcp://[::]:@mysqld.3.#galera_port;ist.recv_addr=[::1]:@mysqld.3.#ist_port'
wsrep_sst_receive_address='[::1]:@mysqld.3.#sst_port'
wsrep_node_address=::1
wsrep_node_incoming_address='[::1]:@mysqld.3.port'
bind-address=::
......@@ -889,12 +889,12 @@ else
if ! mkdir -p "$sstlogarchivedir"; then
sstlogarchivedir=""
wsrep_log_warning \
"Unable to create '$sstlogarchivedir' directory"
"Unable to create '$sstlogarchivedir' directory"
fi
elif [ ! -w "$sstlogarchivedir" ]; then
sstlogarchivedir=""
wsrep_log_warning \
"The '$sstlogarchivedir' directory is not writtable"
"The '$sstlogarchivedir' directory is not writtable"
fi
fi
......@@ -918,7 +918,7 @@ else
newfile="$INNOMOVELOG.$ARCHIVETIMESTAMP"
fi
wsrep_log_info "Moving '$INNOMOVELOG' to '$newfile'"
mv "$INNOMOVELOG" "$newfile" && gzip "$newfile" ||
mv "$INNOMOVELOG" "$newfile" && gzip "$newfile" || \
wsrep_log_warning "Failed to archive log file ('$newfile')"
fi
......@@ -930,7 +930,7 @@ else
newfile="$INNOBACKUPLOG.$ARCHIVETIMESTAMP"
fi
wsrep_log_info "Moving '$INNOBACKUPLOG' to '$newfile'"
mv "$INNOBACKUPLOG" "$newfile" && gzip "$newfile" ||
mv "$INNOBACKUPLOG" "$newfile" && gzip "$newfile" || \
wsrep_log_warning "Failed to archive log file ('$newfile')"
fi
fi
......
......@@ -1133,35 +1133,46 @@ ssize_t wsrep_sst_prepare (void** msg)
char ip_buf[256];
const ssize_t ip_max= sizeof(ip_buf);
wsp::Address* addr_in_parser= NULL;
// Attempt 1: wsrep_sst_receive_address
if (wsrep_sst_receive_address &&
strcmp (wsrep_sst_receive_address, WSREP_SST_ADDRESS_AUTO))
strcmp(wsrep_sst_receive_address, WSREP_SST_ADDRESS_AUTO))
{
addr_in= wsrep_sst_receive_address;
}
addr_in_parser = new wsp::Address(wsrep_sst_receive_address);
if (!addr_in_parser->is_valid())
{
WSREP_ERROR("Could not parse wsrep_sst_receive_address : %s",
wsrep_sst_receive_address);
unireg_abort(1);
}
}
//Attempt 2: wsrep_node_address
else if (wsrep_node_address && strlen(wsrep_node_address))
else if (wsrep_node_address && *wsrep_node_address)
{
wsp::Address addr(wsrep_node_address);
addr_in_parser = new wsp::Address(wsrep_node_address);
if (!addr.is_valid())
if (addr_in_parser->is_valid())
{
// we must not inherit the port number from this address:
addr_in_parser->set_port(0);
}
else
{
WSREP_ERROR("Could not parse wsrep_node_address : %s",
wsrep_node_address);
unireg_abort(1);
}
memcpy(ip_buf, addr.get_address(), addr.get_address_len());
addr_in= ip_buf;
}
// Attempt 3: Try to get the IP from the list of available interfaces.
else
{
ssize_t ret= wsrep_guess_ip (ip_buf, ip_max);
ssize_t ret= wsrep_guess_ip(ip_buf, ip_max);
if (ret && ret < ip_max)
{
addr_in= ip_buf;
addr_in_parser = new wsp::Address(ip_buf);
}
else
{
......@@ -1171,6 +1182,51 @@ ssize_t wsrep_sst_prepare (void** msg)
}
}
assert(addr_in_parser);
size_t len= addr_in_parser->get_address_len();
bool is_ipv6= addr_in_parser->is_ipv6();
const char* address= addr_in_parser->get_address();
if (len > (is_ipv6 ? ip_max - 2 : ip_max))
{
WSREP_ERROR("Address to accept state transfer is too long: '%s'",
address);
unireg_abort(1);
}
if (is_ipv6)
{
/* wsrep_sst_*.sh scripts requite ipv6 addreses to be in square breackets */
ip_buf[0] = '[';
/* the length (len) already includes the null byte: */
memcpy(ip_buf + 1, address, len - 1);
ip_buf[len] = ']';
ip_buf[len + 1] = 0;
len += 2;
}
else
{
memcpy(ip_buf, address, len);
}
int port= addr_in_parser->get_port();
if (port)
{
size_t space= ip_max - len;
ip_buf[len - 1] = ':';
int ret= snprintf(ip_buf + len, ip_max - len, "%d", port);
if (ret <= 0 || (size_t) ret > space)
{
WSREP_ERROR("Address to accept state transfer is too long: '%s:%d'",
address, port);
unireg_abort(1);
}
}
delete addr_in_parser;
addr_in = ip_buf;
ssize_t addr_len= -ENOSYS;
method = wsrep_sst_method;
if (!strcmp(method, WSREP_SST_MYSQLDUMP))
......
......@@ -46,6 +46,7 @@ class Address {
const char* get_address() { return m_address; }
size_t get_address_len() { return m_address_len; }
int get_port() { return m_port; }
void set_port(int port) { m_port= port; }
private:
enum family {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment