[MDEV-26682] slave lock timeout with xa and gap locks Created: 2021-09-25 Updated: 2023-11-10 Resolved: 2021-10-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Replication, Storage Engine - InnoDB, XA |
| Affects Version/s: | 10.5, 10.6 |
| Fix Version/s: | 10.5.13, 10.6.5, 10.7.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Golubchik | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| 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 (
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. |
| Comments |
| Comment by Sergei Golubchik [ 2021-09-28 ] | ||||||||||||||||||||||||
|
Another example of gap locks and XA. This time no purge, no selects on the slave side. This case exploits lock asymmetry — gap lock prevents insert intention lock, but an insert intention lock doesn't prevent a gap lock. We need to execute statements on the master in one order, but have them binlogged in the opposite order:
| ||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2021-10-18 ] | ||||||||||||||||||||||||
|
A possible fix would be to release all non-exclusive locks on XA PREPARE. | ||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-10-18 ] | ||||||||||||||||||||||||
|
c1a9b1c2f21e6796b687 is almost ok.
after that — ok to push, thanks! |