Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1954

Lock wait on INSERT using READ_COMMITTED (3 replies)

$
0
0
Using mysql v5.5.11 with innodb.

I am getting long lock waits, sometimes causing "Lock wait timeout exceeded" error, on INSERT. No deadlock so can't get the deadlock info from SHOW ENGINE INNODB STATUS. I am working to get more details on the failure scenario details, but wanted to ask a general question about innodb locking behavior.

We are using READ_COMMITTED isolation level, so there should be no gap locks, right? I'm wondering in what situation we could get lock waits on an INSERT if no gap locks used by innodb?

We are not doing any explicit locking. One condition that I can think of is a FK column in the INSERTed table, so we get locks in the FK target table for FK constraint validation. So if you INSERT from two connections and both rows reference the same FK value, you would collide on that lock.

Are there any other scenarios where you could get lock contention on INSERT using READ_COMMITTED?

Thanks,

Greg

Viewing all articles
Browse latest Browse all 1954

Trending Articles