1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-20220: Merge 5.7 P_S replication table 'replication_applier_status_by_worker

Step2:
=====
Add two extra columns mentioned below.
---------------------------------------------------------------------------
|Column Name:           |        Description:                             |
|-------------------------------------------------------------------------|
|                       |                                                 |
|WORKER_IDLE_TIME       | Total idle time in seconds that the worker      |
|                       | thread has spent waiting for work from          |
|                       | co-ordinator thread                             |
|                       |                                                 |
|LAST_TRANS_RETRY_COUNT | Total number of retries attempted by last       |
|                       | transaction                                     |
---------------------------------------------------------------------------
This commit is contained in:
Sujatha
2021-04-08 16:09:09 +05:30
parent 94f1d0f84d
commit 036ee61246
9 changed files with 93 additions and 32 deletions

View File

@@ -49,8 +49,7 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_gtid_0_x_100";
include/start_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
retries
1
include/assert.inc [Performance Schema retries should match with actual retries]
SELECT * FROM t1 ORDER BY a;
a b
1 2
@@ -82,8 +81,7 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_gtid_0_x_100,rpl_parallel_simulate_double_temp_err_gtid_0_x_100";
include/start_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
retries
2
include/assert.inc [Performance Schema retries should match with actual retries]
SELECT * FROM t1 ORDER BY a;
a b
1 3
@@ -179,8 +177,7 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_gtid_0_x_100";
include/start_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
retries
1
include/assert.inc [Performance Schema retries should match with actual retries]
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a b
10 4
@@ -224,8 +221,7 @@ SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
include/start_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
retries
1
include/assert.inc [Performance Schema retries should match with actual retries]
SELECT * FROM t1 WHERE a >= 100 ORDER BY a;
a b
100 0
@@ -323,8 +319,7 @@ SET debug_sync='now WAIT_FOR t3_waiting';
SET debug_sync='now SIGNAL t1_start';
SET GLOBAL debug_dbug=@old_dbug;
SET debug_sync='RESET';
retries
1
include/assert.inc [Performance Schema retries should match with actual retries]
SELECT * FROM t3 ORDER BY a;
a b
1 NULL

View File

@@ -28,6 +28,9 @@ include/assert.inc [Value returned by SSS and PS table for Last_Error_Number sho
include/assert.inc [Value returned by SSS and PS table for Last_Error_Message should both be empty.]
include/assert.inc [Value returned by PS table for Last_Error_Timestamp should be 0000-00-00 00:00:00.]
connection master;
connection slave;
include/assert.inc [Value returned by PS table for worker_idle_time should be >= 1]
connection master;
DROP TABLE t1;
connection slave;
STOP SLAVE 'slave1';

View File

@@ -68,9 +68,13 @@ let $old_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', V
--sync_with_master
SET GLOBAL debug_dbug=@old_dbug;
let $new_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1);
--disable_query_log
eval SELECT $new_retry - $old_retry AS retries;
--enable_query_log
let $ps_value= query_get_value(select last_trans_retry_count from
performance_schema.replication_applier_status_by_worker where
last_trans_retry_count > 0, last_trans_retry_count, 1);
let $assert_text= Performance Schema retries should match with actual retries;
let $assert_cond= "$ps_value" = $new_retry - $old_retry;
source include/assert.inc;
SELECT * FROM t1 ORDER BY a;
@@ -100,9 +104,12 @@ let $old_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', V
--sync_with_master
SET GLOBAL debug_dbug=@old_dbug;
let $new_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1);
--disable_query_log
eval SELECT $new_retry - $old_retry AS retries;
--enable_query_log
let $ps_value= query_get_value(select last_trans_retry_count from
performance_schema.replication_applier_status_by_worker where
last_trans_retry_count > 0, last_trans_retry_count, 1);
let $assert_text= Performance Schema retries should match with actual retries;
let $assert_cond= "$ps_value" = $new_retry - $old_retry;
source include/assert.inc;
SELECT * FROM t1 ORDER BY a;
@@ -187,9 +194,12 @@ let $old_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', V
--sync_with_master
SET GLOBAL debug_dbug=@old_dbug;
let $new_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1);
--disable_query_log
eval SELECT $new_retry - $old_retry AS retries;
--enable_query_log
let $ps_value= query_get_value(select last_trans_retry_count from
performance_schema.replication_applier_status_by_worker where
last_trans_retry_count > 0, last_trans_retry_count, 1);
let $assert_text= Performance Schema retries should match with actual retries;
let $assert_cond= "$ps_value" = $new_retry - $old_retry;
source include/assert.inc;
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
SELECT a, LENGTH(b) FROM t2 ORDER BY a;
@@ -235,9 +245,12 @@ let $old_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', V
--sync_with_master
SET GLOBAL debug_dbug=@old_dbug;
let $new_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1);
--disable_query_log
eval SELECT $new_retry - $old_retry AS retries;
--enable_query_log
let $ps_value= query_get_value(select last_trans_retry_count from
performance_schema.replication_applier_status_by_worker where
last_trans_retry_count > 0, last_trans_retry_count, 1);
let $assert_text= Performance Schema retries should match with actual retries;
let $assert_cond= "$ps_value" = $new_retry - $old_retry;
source include/assert.inc;
SELECT * FROM t1 WHERE a >= 100 ORDER BY a;
# Stop the SQL thread. When the bug was there to give the incorrect relay log
@@ -365,9 +378,12 @@ SET debug_sync='now SIGNAL t1_start';
SET GLOBAL debug_dbug=@old_dbug;
SET debug_sync='RESET';
let $new_retry= query_get_value(SHOW STATUS LIKE 'Slave_retried_transactions', Value, 1);
--disable_query_log
eval SELECT $new_retry - $old_retry >= 1 AS retries;
--enable_query_log
let $ps_value= query_get_value(select last_trans_retry_count from
performance_schema.replication_applier_status_by_worker where
last_trans_retry_count > 0, last_trans_retry_count, 1);
let $assert_text= Performance Schema retries should match with actual retries;
let $assert_cond= "$ps_value" = $new_retry - $old_retry;
source include/assert.inc;
SELECT * FROM t3 ORDER BY a;

View File

@@ -113,6 +113,14 @@ let $assert_text= Value returned by PS table for Last_Error_Timestamp should be
let $assert_cond= "$ps_value" = "0000-00-00 00:00:00";
source include/assert.inc;
--connection master
sleep 1;
--connection slave
let $ps_value= query_get_value(select worker_idle_time from performance_schema.replication_applier_status_by_worker, worker_idle_time, 1);
let $assert_text= Value returned by PS table for worker_idle_time should be >= 1;
let $assert_cond= "$ps_value" >= "1";
source include/assert.inc;
--connection master
DROP TABLE t1;
--save_master_pos