Bug #108682 | Read-Committed Isolation, UPDATES wrapped in DROP TEMPORARY TABLE IF EXISTS | ||
---|---|---|---|
Submitted: | 4 Oct 2022 19:32 | Modified: | 6 Oct 2022 9:00 |
Reporter: | Jervin Real | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.7.39 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[4 Oct 2022 19:32]
Jervin Real
[6 Oct 2022 8:53]
MySQL Verification Team
Hi, Have you maybe tried with 8.0.30? I did not reproduce with 8.0.30. Will see how 5.7.39 behaves like. thanks
[6 Oct 2022 9:00]
MySQL Verification Team
Verified with 5.7.39 > show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: 127.0.0.1 Master_User: rsandbox Master_Port: 20640 Connect_Retry: 60 Master_Log_File: mysql-bin.000002 Read_Master_Log_Pos: 985 Relay_Log_File: mysql-relay.000004 Relay_Log_Pos: 619 Relay_Master_Log_File: mysql-bin.000002 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1032 Last_Error: Could not execute Update_rows event on table test.t; Unknown table 'test.tm', Error_code: 1051; Can't find record in 't', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log mysql-bin.000002, end_log_pos 775 Skip_Counter: 0 Exec_Master_Log_Pos: 406 Relay_Log_Space: 1448 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1032 Last_SQL_Error: Could not execute Update_rows event on table test.t; Unknown table 'test.tm', Error_code: 1051; Can't find record in 't', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log mysql-bin.000002, end_log_pos 775 Replicate_Ignore_Server_Ids: Master_Server_Id: 100 Master_UUID: 00020640-1111-1111-1111-111111111111 Master_Info_File: /home/arhimed/sandboxes/rsandbox_5_7_39/node1/data/master.info SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Master_Retry_Count: 86400 Master_Bind: Last_IO_Error_Timestamp: Last_SQL_Error_Timestamp: 221006 10:59:10 Master_SSL_Crl: Master_SSL_Crlpath: Retrieved_Gtid_Set: Executed_Gtid_Set: Auto_Position: 0 Replicate_Rewrite_DB: Channel_Name: Master_TLS_Version: 1 row in set (0.00 sec)
[7 Oct 2022 5:10]
David J
The test case can be simplified to: session1> drop table if exists t; session1> create table t (id int unsigned not null) engine=innodb; session1> insert into t values (1); session1> flush binary logs; session2> set session autocommit=0; session2> set session transaction isolation level read committed; session2> update t set id=2 where id=1; session1> delete from t where id = 1; -- will wait session2> drop temporary table if exists tm; session2> exit session1> delete from t where id = 1; -- will complete
[9 Oct 2022 12:48]
huahua xu
Hi Jervin Real, For your test cases, the order of flushing binlog about these two transactions is not stable, which is caused by the process of transaction rollback. About rolling back the transaction: 1. Firstly, the transaction coordinator rolls back the transaction in the stotage engine, which will releases it's locks(it wakes up possible other transactions because of waiting on these locks) 2. Secondly, flushing binlog of the transaction that cannot be rolled back safely.