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

What is the best way to handle deadlocks (no replies)

$
0
0
Dear Sir,

Wish to seek your advice how can we handle better of the following scenario, as we found too many deadlocks when doing the statements such as SELECT, INSERT ... ON DUPLICATE UPDATE.

Scenario:
We have a busy INNODB table receives incoming requests approximately 5-8 tps.
INSERT INTO ...
ON DUPLICATE UPDATE


Then we have a scheduler to process these requests with following steps:
START TRANSACTION;
UPDATE LockID = 'x' WHERE LockID = '' LIMIT 1000;
SELECT WHERE LockID = 'x';
{
// process the records
}
DELETE WHERE LockID = 'x';
COMMIT;


There are always many deadlocks found especially when SELECT.
Deadlock even occurs when INSERT INTO ... ON DUPLICATE

How shall we handle better of this kind of scenario?
Are we able to check once the table is not occupied by anyone then only perform the scheduler?

Viewing all articles
Browse latest Browse all 1954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>