Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
MDEV-7702 Spiral patch 004_mariadb-10.0.15.slave-trx-retry.diff
This is about adding more options to force slave retries Two new variables has been added: slave_transaction_retry_errors - Tells the slave thread to retry transaction for replication when a query event returns an error from the provided list. Deadlock and elapsed lock wait timeout errors are automatically added to this list slave-transaction-retry-interval - Interval of the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout or listed in slave_transaction_retry_errors Other changes: - Simplifed code for slave_skip_errors (to be aligned with slave_transaction_retry_errors) - Renamed print_slave_skip_errors() to make_slave_skip_errors_printable() - Remove printing error from init_slave_skip_errors as my_bitmap_init() will do that if needed. - Generalize has_temporary_error()
- Loading branch information
Showing
13 changed files
with
595 additions
and
64 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| select @@global.slave_transaction_retry_errors; | ||
| @@global.slave_transaction_retry_errors | ||
| 1213,1205,10,20,400 | ||
| select @@session.slave_transaction_retry_errors; | ||
| ERROR HY000: Variable 'slave_transaction_retry_errors' is a GLOBAL variable | ||
| show global variables like 'slave_transaction_retry_errors'; | ||
| Variable_name Value | ||
| slave_transaction_retry_errors 1213,1205,10,20,400 | ||
| show session variables like 'slave_transaction_retry_errors'; | ||
| Variable_name Value | ||
| slave_transaction_retry_errors 1213,1205,10,20,400 | ||
| select * from information_schema.global_variables where variable_name='slave_transaction_retry_errors'; | ||
| VARIABLE_NAME VARIABLE_VALUE | ||
| SLAVE_TRANSACTION_RETRY_ERRORS 1213,1205,10,20,400 | ||
| select * from information_schema.session_variables where variable_name='slave_transaction_retry_errors'; | ||
| VARIABLE_NAME VARIABLE_VALUE | ||
| SLAVE_TRANSACTION_RETRY_ERRORS 1213,1205,10,20,400 | ||
| set global slave_transaction_retry_errors=1; | ||
| ERROR HY000: Variable 'slave_transaction_retry_errors' is a read only variable | ||
| set session slave_transaction_retry_errors=1; | ||
| ERROR HY000: Variable 'slave_transaction_retry_errors' is a read only variable |
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,126 @@ | ||
| SET @start_global_value = @@global.slave_transaction_retry_interval; | ||
| SELECT @start_global_value; | ||
| @start_global_value | ||
| 0 | ||
| '#--------------------FN_DYNVARS_149_01-------------------------#' | ||
| SET @@global.slave_transaction_retry_interval = 50; | ||
| SET @@global.slave_transaction_retry_interval = DEFAULT; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 0 | ||
| '#--------------------FN_DYNVARS_149_02-------------------------#' | ||
| SET @@global.slave_transaction_retry_interval = DEFAULT; | ||
| SELECT @@global.slave_transaction_retry_interval = 10; | ||
| @@global.slave_transaction_retry_interval = 10 | ||
| 0 | ||
| '#--------------------FN_DYNVARS_149_03-------------------------#' | ||
| SET @@global.slave_transaction_retry_interval = 0; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 0 | ||
| SET @@global.slave_transaction_retry_interval = 1; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 1 | ||
| SET @@global.slave_transaction_retry_interval = 15; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 15 | ||
| SET @@global.slave_transaction_retry_interval = 1024; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 1024 | ||
| SET @@global.slave_transaction_retry_interval = 2147483648; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '2147483648' | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 3600 | ||
| SET @@global.slave_transaction_retry_interval = 2147483648*2-1; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4294967295' | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 3600 | ||
| SET @@global.slave_transaction_retry_interval = 2147483649*2; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4294967298' | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 3600 | ||
| SET @@global.slave_transaction_retry_interval = 4294967295; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4294967295' | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 3600 | ||
| '#--------------------FN_DYNVARS_149_04-------------------------#' | ||
| SET @@slave_transaction_retry_interval = 2; | ||
| ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL | ||
| SET @@session.slave_transaction_retry_interval = 3; | ||
| ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL | ||
| SET @@local.slave_transaction_retry_interval = 4; | ||
| ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL | ||
| '#------------------FN_DYNVARS_149_05-----------------------#' | ||
| SET @@global.slave_transaction_retry_interval = -1; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '-1' | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 0 | ||
| SET @@global.slave_transaction_retry_interval = 2147483649*2147483649; | ||
| Warnings: | ||
| Warning 1292 Truncated incorrect slave_transaction_retry_interval value: '4611686022722355201' | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 3600 | ||
| SET @@global.slave_transaction_retry_interval = 65530.34; | ||
| ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval' | ||
| SET @@global.slave_transaction_retry_interval = '100'; | ||
| ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval' | ||
| SET @@global.slave_transaction_retry_interval = 7483649.56; | ||
| ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval' | ||
| SET @@global.slave_transaction_retry_interval = ON; | ||
| ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval' | ||
| SET @@global.slave_transaction_retry_interval = OFF; | ||
| ERROR 42000: Incorrect argument type to variable 'slave_transaction_retry_interval' | ||
| '#------------------FN_DYNVARS_149_06-----------------------#' | ||
| SET @@global.slave_transaction_retry_interval = 3000; | ||
| SELECT @@global.slave_transaction_retry_interval = VARIABLE_VALUE | ||
| FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES | ||
| WHERE VARIABLE_NAME='slave_transaction_retry_interval'; | ||
| @@global.slave_transaction_retry_interval = VARIABLE_VALUE | ||
| 1 | ||
| '#------------------FN_DYNVARS_149_07-----------------------#' | ||
| SELECT count(VARIABLE_VALUE) | ||
| FROM INFORMATION_SCHEMA.SESSION_VARIABLES | ||
| WHERE VARIABLE_NAME='slave_transaction_retry_interval'; | ||
| count(VARIABLE_VALUE) | ||
| 1 | ||
| '#------------------FN_DYNVARS_149_08-----------------------#' | ||
| SET @@global.slave_transaction_retry_interval = TRUE; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 1 | ||
| SET @@global.slave_transaction_retry_interval = FALSE; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 0 | ||
| '#---------------------FN_DYNVARS_149_09----------------------#' | ||
| SET @@global.slave_transaction_retry_interval = 60*60; | ||
| SELECT @@slave_transaction_retry_interval = @@global.slave_transaction_retry_interval; | ||
| @@slave_transaction_retry_interval = @@global.slave_transaction_retry_interval | ||
| 1 | ||
| '#---------------------FN_DYNVARS_149_10----------------------#' | ||
| SET slave_transaction_retry_interval = 2048; | ||
| ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL | ||
| SELECT slave_transaction_retry_interval; | ||
| ERROR 42S22: Unknown column 'slave_transaction_retry_interval' in 'field list' | ||
| SELECT @@slave_transaction_retry_interval; | ||
| @@slave_transaction_retry_interval | ||
| 3600 | ||
| SET global slave_transaction_retry_interval = 99; | ||
| SET @@global.slave_transaction_retry_interval = @start_global_value; | ||
| SELECT @@global.slave_transaction_retry_interval; | ||
| @@global.slave_transaction_retry_interval | ||
| 0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| --slave_transaction_retry_errors="10,20, 5000, 400" |
Oops, something went wrong.