Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6
-
None
Description
there are, perhaps, may ways that gap locks can be places differently on the master and on the slave. combined with 10.5+ XA binlogging (MDEV-742) this can cause locks to timeout on slaves. breaking replication. For example:
# this test case can be run with read-committed (or higher) isolation leven |
source include/have_innodb.inc;
|
source include/have_binlog_format_row.inc;
|
source include/master-slave.inc;
|
create table t1 (a int primary key, b int unique) engine=innodb; |
insert t1 values (1,1),(3,3),(5,5); |
sync_slave_with_master;
|
|
# set a strong isolation level to keep the read view below. |
# alternatively a long-running select can do that too even in read-committed |
set session tx_isolation='repeatable-read'; |
start transaction; |
# opens a read view to disable purge on the slave |
select * from t1; |
|
connect m2, localhost, root; |
# now, delete a value, purge it on the master, but not on the slave |
delete from t1 where a=3; |
xa start 'x1'; |
# this sets a gap lock on <3>, when it exists (so, on the slave) |
update t1 set b=3 where a=5; |
xa end 'x1'; |
xa prepare 'x1'; |
|
connect m3, localhost, root; |
# and this tries to insert straight into the locked gap |
insert t1 values (2, 2); |
|
echo -->slave; |
sync_slave_with_master;
|
commit; |
select * from t1; |
|
connection m2; |
xa rollback 'x1'; |
drop table t1; |
source include/rpl_end.inc;
|
A possible way to fix all lock timeouts on the slave caused by gap locks and XA is to release gap locks on XA prepare.
Attachments
Issue Links
- causes
-
MDEV-32272 lock_release_on_prepare_try() does not release lock if supremum bit is set along with other bits set in lock's bitmap
- Closed
- duplicates
-
MDEV-26670 Unable to maintain replication since upgrading from 10.4 to 10.5
- Closed
- is caused by
-
MDEV-742 LP:803649 - Xa recovery failed on client disconnection
- Closed
- relates to
-
MDEV-26652 xa transactions binlogged in wrong order
- Stalled
-
MDEV-28709 unexpected X lock on Supremum in READ COMMITTED
- Closed
-
MDEV-33454 release row locks for non-modified rows at XA PREPARE
- Closed
-
MDEV-16142 Merge new release of InnoDB MySQL 5.7.22 to 10.2
- Closed
-
MDEV-35228 Have a configuration variable to enable/disable lock release at XA PREPARE
- Open