Commit 732b89c0 authored by unknown's avatar unknown

BUG#31702 (Missing row on slave causes assertion failure under row-based

replication):

Incremental patch to enable idempotency support for update events again.
The final handling of errors will be done in BUG#31609, and until then
the handling of errors should be consistent between the different types
of changes.


mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result:
  Result change.
mysql-test/suite/rpl/r/rpl_temporary_errors.result:
  Result change.
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Changing test to assume idempotency handling of update event.
mysql-test/suite/rpl/t/rpl_temporary_errors.test:
  Changing test to assume idempotency handling of update event.
sql/log_event.cc:
  Incremental patch to enable idempotency support for the update events again.
  The real error handling will be implemented in BUG#31609.
parent 657c08bd
...@@ -265,7 +265,7 @@ a b ...@@ -265,7 +265,7 @@ a b
5 master 5 master
**** On Slave **** **** On Slave ****
Last_SQL_Error Last_SQL_Error
Error in Update_rows event: error during transaction execution on table test.t1. Can't find record in 't1'
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a b a b
2 master,slave 2 master,slave
......
...@@ -30,7 +30,7 @@ a b ...@@ -30,7 +30,7 @@ a b
**** On Slave **** **** On Slave ****
SHOW STATUS LIKE 'Slave_retried_transactions'; SHOW STATUS LIKE 'Slave_retried_transactions';
Variable_name Value Variable_name Value
Slave_retried_transactions 2 Slave_retried_transactions 0
SELECT * FROM t1; SELECT * FROM t1;
a b a b
5 47 5 47
...@@ -49,17 +49,17 @@ Relay_Log_File # ...@@ -49,17 +49,17 @@ Relay_Log_File #
Relay_Log_Pos # Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001 Relay_Master_Log_File master-bin.000001
Slave_IO_Running Yes Slave_IO_Running Yes
Slave_SQL_Running No Slave_SQL_Running Yes
Replicate_Do_DB Replicate_Do_DB
Replicate_Ignore_DB Replicate_Ignore_DB
Replicate_Do_Table Replicate_Do_Table
Replicate_Ignore_Table # Replicate_Ignore_Table #
Replicate_Wild_Do_Table Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table Replicate_Wild_Ignore_Table
Last_Errno 1032 Last_Errno 0
Last_Error Error in Update_rows event: error during transaction execution on table test.t1. Can't find record in 't1' Last_Error
Skip_Counter 0 Skip_Counter 0
Exec_Master_Log_Pos 318 Exec_Master_Log_Pos 408
Relay_Log_Space # Relay_Log_Space #
Until_Condition None Until_Condition None
Until_Log_File Until_Log_File
...@@ -74,8 +74,8 @@ Seconds_Behind_Master # ...@@ -74,8 +74,8 @@ Seconds_Behind_Master #
Master_SSL_Verify_Server_Cert No Master_SSL_Verify_Server_Cert No
Last_IO_Errno # Last_IO_Errno #
Last_IO_Error # Last_IO_Error #
Last_SQL_Errno 1032 Last_SQL_Errno 0
Last_SQL_Error Error in Update_rows event: error during transaction execution on table test.t1. Can't find record in 't1' Last_SQL_Error
DROP TABLE t1; DROP TABLE t1;
**** On Master **** **** On Master ****
DROP TABLE t1; DROP TABLE t1;
...@@ -245,11 +245,9 @@ SELECT * FROM t1 ORDER BY a; ...@@ -245,11 +245,9 @@ SELECT * FROM t1 ORDER BY a;
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
UPDATE t1 SET a = 5, b = 'master' WHERE a = 1; UPDATE t1 SET a = 5, b = 'master' WHERE a = 1;
save_master_pos;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
--echo **** On Slave **** --echo **** On Slave ****
connection slave; sync_slave_with_master;
source include/wait_for_slave_sql_error.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
disable_query_log; disable_query_log;
eval SELECT "$last_error" AS Last_SQL_Error; eval SELECT "$last_error" AS Last_SQL_Error;
......
...@@ -13,12 +13,10 @@ SELECT * FROM t1; ...@@ -13,12 +13,10 @@ SELECT * FROM t1;
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
UPDATE t1 SET a = 5, b = 5 WHERE a = 1; UPDATE t1 SET a = 5, b = 5 WHERE a = 1;
save_master_pos;
SELECT * FROM t1; SELECT * FROM t1;
#SHOW BINLOG EVENTS; #SHOW BINLOG EVENTS;
--echo **** On Slave **** --echo **** On Slave ****
connection slave; sync_slave_with_master;
source include/wait_for_slave_sql_to_stop.inc;
SHOW STATUS LIKE 'Slave_retried_transactions'; SHOW STATUS LIKE 'Slave_retried_transactions';
SELECT * FROM t1; SELECT * FROM t1;
source include/show_slave_status.inc; source include/show_slave_status.inc;
......
...@@ -6180,12 +6180,9 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) ...@@ -6180,12 +6180,9 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli)
case HA_ERR_RECORD_CHANGED: case HA_ERR_RECORD_CHANGED:
case HA_ERR_KEY_NOT_FOUND: /* Idempotency support: OK if case HA_ERR_KEY_NOT_FOUND: /* Idempotency support: OK if
tuple does not exist */ tuple does not exist */
if (get_type_code() != UPDATE_ROWS_EVENT)
{
error= 0; error= 0;
break; break;
}
/* Fall through in the event that we have an update event */
default: default:
rli->report(ERROR_LEVEL, thd->net.last_errno, rli->report(ERROR_LEVEL, thd->net.last_errno,
"Error in %s event: row application failed. %s", "Error in %s event: row application failed. %s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment