[MDEV-7702] Spiral patch 004_mariadb-10.0.15.slave-trx-retry.diff Created: 2015-03-11  Updated: 2017-12-03  Resolved: 2017-11-06

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - Spider
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: spiral_p04

Attachments: File 004_mariadb-10.0.15.slave-trx-retry.diff    
Epic Link: Spiral patches

 Description   

Description:
This patch is for retrying trunsaction when slave sql thread get error number which setted to parameter.
Background:
Before applying this patch, slave sql thread is stopped when Spider connection is broken at updating by sql thread. So I made it for retrying transaction. But this feature is designed for general purpos
+e.
Paramater setting example:
slave_transaction_retry_errors=1158,1159,2013,12701
slave_transaction_retry_interval=10



 Comments   
Comment by Sergey Vojtovich [ 2015-03-11 ]

Kristian, please review and apply attached patch. If you disagree with this patch or need any feedback from contributor, please post your comments here and set status to stalled.

Comment by Michael Widenius [ 2016-12-05 ]

It would be good to know which are the common error numbers that one would need to use with slave_transaction_retry_error when using Spider. This is needed when we document Spider and also as a recommendation when configuring MariaDB with
Spider usage.

Kentoku, do you have any suggestions for the error numbers that one should use?

Comment by Kentoku Shiba (Inactive) [ 2016-12-13 ]

I suggest the following errors.
1158: Got an error reading communication packets
1159: Got timeout reading communication packets
1160: Got an error writing communication packets
1161: Got timeout writing communication packets
2013: Lost connection to MySQL server during query
12701: Remote MySQL server has gone away

Comment by Michael Widenius [ 2017-11-06 ]

Pushed into bb-10.2-spider

Here is the commit comment:

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:

  • Simplified 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()
Comment by Michael Widenius [ 2017-11-06 ]

Cleaned up and pushed into bb-10.2-spider

Comment by Michael Widenius [ 2017-11-06 ]

The new system variables has been added to the KB

Generated at Thu Feb 08 07:21:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.