You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MDEV-35304: Add Connects_Tried and Master_Retry_Count to SSS
When the IO thread (re)connect to a primary, no updates are available besides unique errors that cause the failure. These new `Master_info` numbers supplement SHOW SLAVE STATUS’s (most- recent) ‘Connecting’ state with statistics on (re)connect attempts: * `Connects_Tried`: how many retries have been attempted so far This was previously a local variable that only counted re-attempts; it’s now meaningful even after the “Connecting” state concludes. * `Master_Retry_Count` (from MDEV-25674): out of how many configured Side-note: Some of the tests updated by this commit dump the entire SHOW SLAVE STATUS, which might include non-deterministic entries. Reviewed-by: Kristian Nielsen <knielsen@knielsen-hq.org> Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com>
Copy file name to clipboardExpand all lines: mysql-test/main/master_retry_count_basic.result
+41-29Lines changed: 41 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1,67 +1,79 @@
1
1
# Use `--master-retry-count` when not specified
2
2
CHANGE MASTER 'named' TO master_host='example.com';
3
3
CHANGE MASTER TO master_host='127.0.0.1', master_ssl_verify_server_cert=0;
4
-
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
5
-
FROM performance_schema.replication_connection_configuration;
6
-
CHANNEL_NAME CONNECTION_RETRY_COUNT
7
-
named 1
4
+
SELECT Connection_name, Master_Retry_Count
5
+
FROM information_schema.SLAVE_STATUS;
6
+
Connection_name Master_Retry_Count
8
7
1
8
+
named 1
9
9
# Replace when specified
10
10
CHANGE MASTER 'named' TO master_retry_count=11;
11
11
CHANGE MASTER TO master_retry_count=10;
12
+
SELECT Connection_name, Master_Retry_Count
13
+
FROM information_schema.SLAVE_STATUS;
14
+
Connection_name Master_Retry_Count
15
+
10
16
+
named 11
17
+
# Conventional views also show the configuations
18
+
Connection_name = ''
19
+
Connection_name = 'named'
20
+
Master_Retry_Count = '10'
21
+
Master_Retry_Count = '11'
22
+
Master_Retry_Count = '10'
23
+
Master_Retry_Count = '11'
12
24
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
13
25
FROM performance_schema.replication_connection_configuration;
14
26
CHANNEL_NAME CONNECTION_RETRY_COUNT
15
27
named 11
16
28
10
17
29
# Restore specified config on restart
18
30
# restart: --skip-slave-start
19
-
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
20
-
FROM performance_schema.replication_connection_configuration;
21
-
CHANNEL_NAME CONNECTION_RETRY_COUNT
22
-
named 11
31
+
SELECT Connection_name, Master_Retry_Count
32
+
FROM information_schema.SLAVE_STATUS;
33
+
Connection_name Master_Retry_Count
23
34
10
35
+
named 11
24
36
# Keep specified config on RESET REPLICA
25
37
RESET REPLICA 'named';
26
38
RESET REPLICA;
27
-
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
28
-
FROM performance_schema.replication_connection_configuration;
29
-
CHANNEL_NAME CONNECTION_RETRY_COUNT
30
-
named 11
39
+
SELECT Connection_name, Master_Retry_Count
40
+
FROM information_schema.SLAVE_STATUS;
41
+
Connection_name Master_Retry_Count
31
42
10
43
+
named 11
32
44
# Don't replace when not specified
33
45
CHANGE MASTER TO master_user='root';
34
46
CHANGE MASTER 'named' TO master_user='root';
35
-
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
36
-
FROM performance_schema.replication_connection_configuration;
37
-
CHANNEL_NAME CONNECTION_RETRY_COUNT
38
-
named 11
47
+
SELECT Connection_name, Master_Retry_Count
48
+
FROM information_schema.SLAVE_STATUS;
49
+
Connection_name Master_Retry_Count
39
50
10
51
+
named 11
40
52
# 0 internally means "not specified"
41
53
CHANGE MASTER TO master_retry_count=0;
42
54
CHANGE MASTER 'named' TO master_retry_count=0;
43
-
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
44
-
FROM performance_schema.replication_connection_configuration;
45
-
CHANNEL_NAME CONNECTION_RETRY_COUNT
46
-
named 11
55
+
SELECT Connection_name, Master_Retry_Count
56
+
FROM information_schema.SLAVE_STATUS;
57
+
Connection_name Master_Retry_Count
47
58
10
59
+
named 11
48
60
# Truncates decimals
49
61
CHANGE MASTER TO master_retry_count=0.5;
50
62
CHANGE MASTER 'named' TO master_retry_count=0.5;
51
-
SELECT CHANNEL_NAME, CONNECTION_RETRY_COUNT
52
-
FROM performance_schema.replication_connection_configuration;
53
-
CHANNEL_NAME CONNECTION_RETRY_COUNT
54
-
named 11
63
+
SELECT Connection_name, Master_Retry_Count
64
+
FROM information_schema.SLAVE_STATUS;
65
+
Connection_name Master_Retry_Count
55
66
10
67
+
named 11
56
68
# Caps values (such as UINT64_MAX + 1) to `--master-retry-count`'s max
57
69
CHANGE MASTER TO master_retry_count=18446744073709551616;
58
70
CHANGE MASTER 'named' TO master_retry_count=18446744073709551616;
59
-
SELECT CHANNEL_NAME
60
-
FROM performance_schema.replication_connection_configuration
61
-
WHERE CONNECTION_RETRY_COUNT IN (4294967295, 18446744073709551615);
62
-
CHANNEL_NAME
63
-
named
71
+
SELECT Connection_name
72
+
FROM information_schema.SLAVE_STATUS
73
+
WHERE Master_Retry_Count IN (4294967295, 18446744073709551615);
74
+
Connection_name
64
75
76
+
named
65
77
# Negative
66
78
CHANGE MASTER TO master_retry_count=-1;
67
79
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-1' at line 1
def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
391
391
def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL NO NO
392
392
def information_schema SLAVE_STATUS Connection_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
393
+
def information_schema SLAVE_STATUS Connects_Tried 57 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select NEVER NULL NO NO
393
394
def information_schema SLAVE_STATUS Connect_Retry 7 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO
394
-
def information_schema SLAVE_STATUS Executed_log_entries59NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO
395
+
def information_schema SLAVE_STATUS Executed_log_entries61NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO
395
396
def information_schema SLAVE_STATUS Exec_Master_Log_Pos 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select NEVER NULL NO NO
396
397
def information_schema SLAVE_STATUS Gtid_IO_Pos 46 NULL NO varchar 21844 65532 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21844) select NEVER NULL NO NO
397
-
def information_schema SLAVE_STATUS Gtid_Slave_Pos62NULL NO varchar 21844 65532 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21844) select NEVER NULL NO NO
398
+
def information_schema SLAVE_STATUS Gtid_Slave_Pos64NULL NO varchar 21844 65532 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21844) select NEVER NULL NO NO
398
399
def information_schema SLAVE_STATUS Last_Errno 21 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(4) unsigned select NEVER NULL NO NO
399
400
def information_schema SLAVE_STATUS Last_Error 22 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO
400
401
def information_schema SLAVE_STATUS Last_IO_Errno 37 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(4) unsigned select NEVER NULL NO NO
401
402
def information_schema SLAVE_STATUS Last_IO_Error 38 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO
402
403
def information_schema SLAVE_STATUS Last_SQL_Errno 39 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(4) unsigned select NEVER NULL NO NO
403
404
def information_schema SLAVE_STATUS Last_SQL_Error 40 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO
404
405
def information_schema SLAVE_STATUS Master_Host 4 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select NEVER NULL NO NO
405
-
def information_schema SLAVE_STATUS Master_last_event_time63NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
406
+
def information_schema SLAVE_STATUS Master_last_event_time65NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
406
407
def information_schema SLAVE_STATUS Master_Log_File 8 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
407
408
def information_schema SLAVE_STATUS Master_Port 6 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select NEVER NULL NO NO
409
+
def information_schema SLAVE_STATUS Master_Retry_Count 58 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select NEVER NULL NO NO
408
410
def information_schema SLAVE_STATUS Master_Server_Id 42 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO
409
-
def information_schema SLAVE_STATUS Master_Slave_time_diff65NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO
411
+
def information_schema SLAVE_STATUS Master_Slave_time_diff67NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select NEVER NULL NO NO
410
412
def information_schema SLAVE_STATUS Master_SSL_Allowed 29 NULL YES varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL NO NO
411
413
def information_schema SLAVE_STATUS Master_SSL_CA_File 30 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
412
414
def information_schema SLAVE_STATUS Master_SSL_CA_Path 31 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
0 commit comments