InnoDB Gap Lock Contention Causing Latency Spikes Under Concurrent Range Scans
When multiple concurrent transactions execute range-based SELECT ... FOR UPDATE or range DELETE statements under REPEATABLE READ isolation, InnoDB acquires next-key locks that combine record locks with gap locks on the scanned index intervals. This locking behavior prevents phantom reads but can serialize inserts into the same gaps even when the inserted val