-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG#25082593 FOREIGN KEY VALIDATION DOESN'T NEED TO ACQUIRE GAP LOCK …
…IN READ COMMITTED Problem : --------- This bug is filed from the base replication bug#25040331 where the slave thread times out while INSERT operation waits on GAP lock taken during Foreign Key validation. The primary reason for the lock wait is because the statements are getting replayed in different order. However, we also observed two things ... 1. The slave thread could always use "Read Committed" isolation for row level replication. 2. It is not necessary to have GAP locks in "READ Committed" isolation level in innodb. This bug is filed to address point(2) to avoid taking GAP locks during Foreign Key validation. Solution : ---------- Innodb is primarily designed for "Repeatable Read" and the GAP lock behaviour is default. For "Read Committed" isolation, we have special handling in row_search_mvcc to avoid taking the GAP lock while scanning records. While looking for Foreign Key, the code is following the default behaviour taking GAP locks. The suggested fix is to avoid GAP locking during FK validation similar to normal search operation (row_search_mvcc) for "Read Committed" isolation level. Reviewed-by: Sunny Bains <sunny.bains@oracle.com> RB: 14526
- Loading branch information
Showing
3 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters