Skip to content

Commit

Permalink
MDEV-16437: merge 5.7 P_S replication instrumentation and tables
Browse files Browse the repository at this point in the history
Merge 'replication_connection_configuration' table.

Replaced following column:
  - AUTO_POSITION with USING_GTID
Added new columns for:
  - IGNORE_SERVER_IDS
  - DO_DOMAIN_IDS
  - IGNORE_SERVER_IDS
Removed following columns as they are not part of mariadb replication
connection configuration:
  - NETWORK_INTERFACE
  - TLS_VERSION

@sql/mysqld.cc
  Changed "master-retry-count" default value to 100000.
  • Loading branch information
sujatha-s committed Apr 16, 2021
1 parent 5c76e1e commit 2674365
Show file tree
Hide file tree
Showing 10 changed files with 1,026 additions and 86 deletions.
2 changes: 1 addition & 1 deletion mysql-test/main/mysqld--help.result
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ long-query-time 10
low-priority-updates FALSE
lower-case-table-names 1
master-info-file master.info
master-retry-count 86400
master-retry-count 100000
master-verify-checksum FALSE
max-allowed-packet 16777216
max-binlog-cache-size 18446744073709547520
Expand Down
420 changes: 410 additions & 10 deletions mysql-test/suite/multi_source/simple.result

Large diffs are not rendered by default.

15 changes: 11 additions & 4 deletions mysql-test/suite/multi_source/simple.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

--source include/not_embedded.inc
--source include/binlog_start_pos.inc
--source include/have_perfschema.inc
--let $rpl_server_count= 0

--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
Expand Down Expand Up @@ -46,7 +47,13 @@ let relay_log_pos=`select 2*$binlog_start_pos + 117`;
let relay_log_space1=`select 3*$binlog_start_pos + 178`;
let relay_log_space2=`select 3*$binlog_start_pos + 178`;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
query_vertical show all slaves status;

--echo #
--echo # MDEV:16437: merge 5.7 P_S replication instrumentation and tables
--echo #
--replace_column 3 #
query_vertical select * from performance_schema.replication_connection_configuration;

# Ensure that start all slaves doesn't do anything as all slaves are started
start all slaves;
Expand All @@ -58,15 +65,15 @@ query_vertical show slave 'slave1' status;

reset slave 'slave1';
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
query_vertical show all slaves status;

reset slave 'slave1' all;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
query_vertical show all slaves status;

stop all slaves;
--replace_result $SERVER_MYPORT_1 MYPORT_1 $SERVER_MYPORT_2 MYPORT_2 $read_master_log_pos <read_master_log_pos> $relay_log_pos <relay_log_pos> $relay_log_space1 <relay_log_space1> $relay_log_space2 <relay_log_space2>
show all slaves status;
query_vertical show all slaves status;

# Ensure that start all slaves doesn't do anything as all slaves are stopped
stop all slaves;
Expand Down
33 changes: 17 additions & 16 deletions mysql-test/suite/perfschema/r/table_schema.result
Original file line number Diff line number Diff line change
Expand Up @@ -874,25 +874,26 @@ def performance_schema replication_applier_status_by_worker LAST_ERROR_MESSAGE 6
def performance_schema replication_applier_status_by_worker LAST_ERROR_TIMESTAMP 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
def performance_schema replication_applier_status_by_worker WORKER_IDLE_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
def performance_schema replication_applier_status_by_worker LAST_TRANS_RETRY_COUNT 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration CHANNEL_NAME 1 NULL NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8 utf8_general_ci varchar(256) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration HOST 2 NULL NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration PORT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration USER 4 NULL NO char 32 96 NULL NULL NULL utf8 utf8_bin char(32) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration NETWORK_INTERFACE 5 NULL NO char 60 180 NULL NULL NULL utf8 utf8_bin char(60) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration AUTO_POSITION 6 NULL NO enum 1 3 NULL NULL NULL utf8 utf8_general_ci enum('1','0') select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_ALLOWED 7 NULL NO enum 7 21 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO','IGNORED') select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CA_FILE 8 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CA_PATH 9 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CERTIFICATE 10 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CIPHER 11 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_KEY 12 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_VERIFY_SERVER_CERTIFICATE 13 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CRL_FILE 14 NULL NO varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CRL_PATH 15 NULL NO varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration CONNECTION_RETRY_INTERVAL 16 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration CONNECTION_RETRY_COUNT 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration HEARTBEAT_INTERVAL 18 NULL NO double NULL NULL 10 3 NULL NULL NULL double(10,3) unsigned select,insert,update,references Number of seconds after which a heartbeat will be sent . NEVER NULL
def performance_schema replication_connection_configuration TLS_VERSION 19 NULL NO varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration USING_GTID 5 NULL NO enum 11 33 NULL NULL NULL utf8 utf8_general_ci enum('NO','CURRENT_POS','SLAVE_POS') select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_ALLOWED 6 NULL NO enum 7 21 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO','IGNORED') select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CA_FILE 7 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CA_PATH 8 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CERTIFICATE 9 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CIPHER 10 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_KEY 11 NULL NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_VERIFY_SERVER_CERTIFICATE 12 NULL NO enum 3 9 NULL NULL NULL utf8 utf8_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CRL_FILE 13 NULL NO varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration SSL_CRL_PATH 14 NULL NO varchar 255 765 NULL NULL NULL utf8 utf8_general_ci varchar(255) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration CONNECTION_RETRY_INTERVAL 15 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration CONNECTION_RETRY_COUNT 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration HEARTBEAT_INTERVAL 17 NULL NO double NULL NULL 10 3 NULL NULL NULL double(10,3) unsigned select,insert,update,references Number of seconds after which a heartbeat will be sent . NEVER NULL
def performance_schema replication_connection_configuration IGNORE_SERVER_IDS 18 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration REPL_DO_DOMAIN_IDS 19 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
def performance_schema replication_connection_configuration REPL_IGNORE_DOMAIN_IDS 20 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select,insert,update,references NEVER NULL
def performance_schema rwlock_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8 utf8_general_ci varchar(128) select,insert,update,references NEVER NULL
def performance_schema rwlock_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
def performance_schema rwlock_instances WRITE_LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
Expand Down
124 changes: 124 additions & 0 deletions mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
include/master-slave.inc
[connection master]
# Asserted this: On master, the table should return an empty set.
connection slave;

# Verify that SELECT works for every field and produces an output
# similar to the corresponding field in SHOW SLAVE STATUS(SSS).

include/assert.inc [Value returned by SSS and PS table for Host should be same.]
include/assert.inc [Value returned by SSS and PS table for Port should be same.]
include/assert.inc [Value returned by SSS and PS table for User should be same.]
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Allowed should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_File should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_Path should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Certificate should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Cipher should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Key should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Verify_Server_Certificate should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Crl_File should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Crl_Path should be same.]
include/assert.inc [Value returned by SSS and PS table for Connection_Retry_Interval should be same.]
include/assert.inc [Value returned by PS table for Connection_Retry_Count should be 10.]

# Heartbeat_Interval is part of I_S and P_S. We will compare the
# two to make sure both match.

include/assert.inc [Value returned by IS and PS table for Heartbeat_Interval should be same.]

# Change configuration parameters and verify that these changes
# are shown correctly by SELECTs from PS table.

connection master;
create user replssl@localhost;
grant replication slave on *.* to replssl@localhost require ssl;
include/sync_slave_sql_with_master.inc
include/stop_slave.inc
change master to
master_user= 'replssl',
master_password= '',
master_ssl= 1,
master_ssl_ca= 'MYSQL_TEST_DIR/std_data/cacert.pem',
master_ssl_cert= 'MYSQL_TEST_DIR/std_data/client-cert.pem',
master_ssl_key= 'MYSQL_TEST_DIR/std_data/client-key.pem';
include/start_slave.inc
connection slave;

# Checking SSL parameters, they were empty in tests done in the
# previous section.

include/assert.inc [Value returned by SSS and PS table for SSL_Allowed should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_File should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_CA_Path should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Certificate should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Cipher should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Key should be same.]
include/assert.inc [Value returned by SSS and PS table for SSL_Verify_Server_Certificate should be same.]
connection master;
drop user replssl@localhost;
connection slave;
include/stop_slave.inc
CHANGE MASTER TO
master_host= '127.0.0.1',
master_user= 'root',
master_password= '',
master_ssl_ca= '',
master_ssl_cert= '',
master_ssl_key= '',
master_ssl_verify_server_cert=0,
master_ssl=0,
master_use_gtid=no;
include/start_slave.inc

# Test with different MASTER_USE_GTID values


# 1) Test for MASTER_USE_GTID=NO

include/stop_slave.inc
change master to
master_user = 'root',
master_use_gtid = NO;
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]

# 2) Test for Auto_position= CURRENT_POS.

change master to
master_user = 'root',
master_use_gtid= CURRENT_POS;
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]

# 3) Test for Auto_position= SLAVE_POS

change master to
master_user = 'root',
master_use_gtid= SLAVE_POS;
include/assert.inc [Value returned by SSS and PS table for Using_Gtid should be same.]

# Test INOGRE_SERVER_IDS


# 1) Test for IGNORE_SERVER_IDS= (10, 100);

connection slave;
change master to IGNORE_SERVER_IDS= (10, 100);
include/assert.inc [Value returned by SSS and PS table for Ignore_server_ids should be same.]
CHANGE MASTER TO IGNORE_SERVER_IDS=();

# 2) Test for IGNORE_DOMAIN_IDS(2)

CHANGE MASTER TO IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
include/assert.inc [Value returned by SSS and PS table for Replicate_Ignore_Domain_Ids should be same.]
include/stop_slave.inc

# 3) Test for DO_DOMAIN_IDS(1)

CHANGE MASTER TO DO_DOMAIN_IDS=(1), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
include/assert.inc [Value returned by SSS and PS table for Replicate_Do_Domain_Ids should be same.]
include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
include/start_slave.inc
include/rpl_end.inc
Loading

0 comments on commit 2674365

Please sign in to comment.