2012-06-28 03:03:13 |
yinfeng |
bug |
|
|
added bug |
2012-06-28 03:03:13 |
yinfeng |
attachment added |
|
slave_smart_mode.diff https://bugs.launchpad.net/bugs/1018685/+attachment/3206284/+files/slave_smart_mode.diff |
|
2012-06-28 03:05:02 |
yinfeng |
description |
Replication is often interrupted because of some errors, and the most common errors we encountered recently are "HA_ERR_KEY_NOT_FOUND" and "HA_ERR_FOUND_DUPP_KEY".
there are two methods to handle the errors:
1). ignore the error by setting "sql_slave_skip_counter".
2).set slave_exec_mode = "idempotent" to handle "HA_ERR_FOUND_DUPP_KEY" (overwritten the record) and "HA_ERR_KEY_NOT_FOUND"(just ignore the error).
Both methods may lead to inconsistencies between master and slave.
if we are using row-based replication and innodb storage engine , why don't we fix these errors instead of simply ignore it?
So I introduced in a new value of slave_exec_mode: SMART
a simple idea is :
1) HA_ERR_KEY_NOT_FOUND
UPDATE_ROWS_EVENT: write 'Before Image' of the record, and then update it
WRITE_ROWS_EVENT: write the record and then delete it , or just ignore the error
2)HA_ERR_FOUND_DUPP_KEY
WRITE_ROWS_EVENT: just overwrite the record
UPDATE_ROWS_EVENT : delete the duplicated record and then update (if the error is caused because of duplicated unique key and the table also has a primary key , the fix may failed and all changes can be rollback)
The attached file is a simple patch based on Percona-Server-5.5.24-rel26.0, and it is still under the testing. |
Replication is often interrupted because of some errors, and the most common errors we encountered recently are "HA_ERR_KEY_NOT_FOUND" and "HA_ERR_FOUND_DUPP_KEY".
there are two methods to handle the errors:
1). ignore the error by setting "sql_slave_skip_counter".
2).set slave_exec_mode = "idempotent" to handle "HA_ERR_FOUND_DUPP_KEY" (overwritten the record) and "HA_ERR_KEY_NOT_FOUND"(just ignore the error).
Both methods may lead to inconsistencies between master and slave.
if we are using row-based replication and innodb storage engine , why don't we fix these errors instead of simply ignore it?
So I introduced in a new value of slave_exec_mode: SMART
a simple idea is :
1) HA_ERR_KEY_NOT_FOUND
UPDATE_ROWS_EVENT: write 'Before Image' of the record, and then update it
DELETE_ROWS_EVENT: write the record and then delete it , or just ignore the error
2)HA_ERR_FOUND_DUPP_KEY
WRITE_ROWS_EVENT: just overwrite the record
UPDATE_ROWS_EVENT : delete the duplicated record and then update (if the error is caused because of duplicated unique key and the table also has a primary key , the fix may failed and all changes can be rollback)
The attached file is a simple patch based on Percona-Server-5.5.24-rel26.0, and it is still under the testing. |
|
2012-06-28 14:35:31 |
Raghavendra D Prabhu |
bug |
|
|
added subscriber Raghavendra D Prabhu |
2012-08-03 06:20:58 |
Hui Liu |
attachment added |
|
smart.patch https://bugs.launchpad.net/percona-server/+bug/1018685/+attachment/3246589/+files/smart.patch |
|
2012-08-03 06:33:27 |
Laurynas Biveinis |
tags |
|
contribution |
|
2012-09-12 00:28:17 |
Raghavendra D Prabhu |
percona-server: assignee |
|
Raghavendra D Prabhu (raghavendra-prabhu) |
|
2012-09-12 07:11:31 |
Laurynas Biveinis |
nominated for series |
|
percona-server/5.5 |
|
2012-09-12 07:11:31 |
Laurynas Biveinis |
bug task added |
|
percona-server/5.5 |
|
2012-09-12 07:11:38 |
Laurynas Biveinis |
percona-server/5.5: importance |
Undecided |
Wishlist |
|
2012-09-18 06:29:02 |
Raghavendra D Prabhu |
percona-server/5.5: status |
New |
Triaged |
|
2012-09-18 06:29:13 |
Raghavendra D Prabhu |
percona-server/5.5: assignee |
Raghavendra D Prabhu (raghavendra-prabhu) |
|
|
2016-03-23 16:46:19 |
Laurynas Biveinis |
nominated for series |
|
percona-server/5.6 |
|
2016-03-23 16:46:19 |
Laurynas Biveinis |
bug task added |
|
percona-server/5.6 |
|
2016-03-23 16:46:19 |
Laurynas Biveinis |
nominated for series |
|
percona-server/5.1 |
|
2016-03-23 16:46:19 |
Laurynas Biveinis |
bug task added |
|
percona-server/5.1 |
|
2016-03-23 16:46:19 |
Laurynas Biveinis |
nominated for series |
|
percona-server/5.7 |
|
2016-03-23 16:46:19 |
Laurynas Biveinis |
bug task added |
|
percona-server/5.7 |
|
2016-03-23 16:50:13 |
Laurynas Biveinis |
percona-server/5.1: status |
New |
Won't Fix |
|
2016-03-23 16:50:14 |
Laurynas Biveinis |
percona-server/5.1: importance |
Undecided |
Wishlist |
|
2016-03-23 16:50:17 |
Laurynas Biveinis |
percona-server/5.6: status |
New |
Triaged |
|
2016-03-23 16:50:19 |
Laurynas Biveinis |
percona-server/5.6: importance |
Undecided |
Wishlist |
|