-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-16437: merge 5.7 P_S replication instrumentation and tables
Merge 'replication_applier_status_by_coordinator' table. This table captures SQL_THREAD status in case of both single threaded and multi threaded slave configuration. When multi_source replication is enabled this table will display each source specific SQL_THREAD status. Added new columns for: - LAST_SEEN_TRANSACTION - LAST_TRANS_RETRY_COUNT
- Loading branch information
Showing
14 changed files
with
551 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_coordinator.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
include/master-slave.inc | ||
[connection master] | ||
call mtr.add_suppression("Error 'Table 'test.t' doesn't exist' on query."); | ||
include/assert.inc [On master, the table should return an empty set.] | ||
connection slave; | ||
include/wait_for_slave_param.inc [Slave_SQL_Running_State] | ||
|
||
# Testing on fresh slave. | ||
|
||
include/assert.inc [thread_name should should indicate sql thread.] | ||
include/assert.inc [SSS shows Slave_IO_Running as "Yes". So, Service_State from this PS table should be "ON".] | ||
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.] | ||
include/assert.inc [Value returned by SSS and PS table for Last_Error_Message should be same.] | ||
include/assert.inc [Value returned by SSS and PS table for Last_Error_Timestamp should be 0000-00-00 00:00:00.] | ||
include/assert.inc [Last_trans_retry_count should be 0.] | ||
|
||
# Cause an error in the SQL thread and check for the correctness of | ||
# values in error number, message and timestamp fields. | ||
|
||
connection master; | ||
use test; | ||
create table t(a int primary key); | ||
include/sync_slave_sql_with_master.inc | ||
drop table t; | ||
connection master; | ||
insert into t values(1); | ||
connection slave; | ||
include/wait_for_slave_sql_error.inc [errno=1146] | ||
|
||
# Extract the error related fields from SSS and PS table and compare | ||
# them for correctness. | ||
|
||
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.] | ||
Value returned by SSS and PS table for Last_Error_Message is same. | ||
|
||
# Verify that the error fields are preserved after STOP SLAVE, thread_id | ||
# changes to NULL and service_state changes to "Off". | ||
|
||
|
||
# 1. Verify that thread_id changes to NULL and service_state to "off" on | ||
# STOP SLAVE. | ||
|
||
include/assert.inc [After STOP SLAVE, thread_id should be NULL] | ||
include/assert.inc [SSS shows Slave_SQL_Running as "No". So, Service_State from this PS table should be "OFF".] | ||
|
||
# 2. Extract the error related fields from SSS and PS table and compare | ||
# them. These fields should preserve their values. | ||
|
||
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.] | ||
Value returned by SSS and PS table for Last_Error_Message is same. | ||
connection master; | ||
drop table t; | ||
reset master; | ||
connection slave; | ||
include/stop_slave.inc | ||
reset slave; | ||
reset master; | ||
set @saved_slave_trans_retry_interval= @@GLOBAL.slave_transaction_retry_interval; | ||
set global slave_transaction_retry_interval=1; | ||
include/start_slave.inc | ||
# | ||
# Test Last_Trans_Retry_Count value. | ||
# | ||
connection master; | ||
create table t1 (f int primary key) engine=innodb; | ||
insert into t1 values (10); | ||
connection slave; | ||
connect slave2,127.0.0.1,root,,test,$SLAVE_MYPORT,; | ||
connection slave2; | ||
begin; | ||
update t1 set f=40 where f=10; | ||
connection master; | ||
begin; | ||
update t1 set f=60 where f=10; | ||
commit; | ||
connection slave; | ||
connection slave2; | ||
rollback; | ||
include/assert.inc [Value returned by PS table for Last_Trans_Retry_Count should be > 0.] | ||
connection master; | ||
drop table t1; | ||
connection slave; | ||
disconnect slave2; | ||
set global slave_transaction_retry_interval=@saved_slave_trans_retry_interval; | ||
include/stop_slave.inc | ||
|
||
# Restarting servers and setting up MTS now. Since, SQL thread and | ||
# coordinator are the same and follow same code path, we can skip | ||
# testing for coordinator thread in all scenarios. Testing for one | ||
# scenario is enough. | ||
|
||
include/rpl_restart_server.inc [server_number=1] | ||
include/rpl_restart_server.inc [server_number=2] | ||
connection slave; | ||
change master to | ||
master_host='127.0.0.1', | ||
master_port=MASTER_MYPORT, | ||
master_user='root'; | ||
SET @save.slave_parallel_workers=@@global.slave_parallel_workers; | ||
SET @@global.slave_parallel_workers=1; | ||
set @save.slave_transaction_retries= @@global.slave_transaction_retries; | ||
include/start_slave.inc | ||
include/wait_for_slave_param.inc [Slave_SQL_Running_State] | ||
include/assert.inc [thread_name should should indicate sql thread.] | ||
include/assert.inc [SSS shows Slave_SQL_Running as "Yes". So, Service_State from this PS table should be "ON".] | ||
include/assert.inc [Value returned by SSS and PS table for Last_Error_Number should be same.] | ||
|
||
# Cleanup. | ||
|
||
include/stop_slave.inc | ||
set @@global.slave_parallel_workers= @save.slave_parallel_workers; | ||
set @@global.slave_transaction_retries= @save.slave_transaction_retries; | ||
include/start_slave.inc | ||
include/rpl_end.inc |
1 change: 1 addition & 0 deletions
1
mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_coordinator-slave.opt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--loose-innodb-lock-wait-timeout=1 |
Oops, something went wrong.