rpush: Database deadlock

Hi , I encounter a problem about rpush, and try to fix it. But I can’t find the root cause of

  1. Rpush version: 2.4.0
  2. rpush run in two host.
*** (1) TRANSACTION:
mysql tables in use 1, locked 1
LOCK WAIT 22 lock struct(s), heap size 3112, 240 row lock(s)
query id 2154897537 rpushhost1 Creating sort index
SELECT `rpush_notifications`.* FROM `rpush_notifications` WHERE (processing = 0 AND delivered = 0 AND failed = 0 AND (deliver_after IS NULL OR deliver_after < '2015-09-08 06:23:19')) ORDER BY created_at ASC LIMIT 100 FOR UPDATE

*** (2) TRANSACTION:
mysql tables in use 1, locked 1
3 lock struct(s), heap size 1248, 2 row lock(s), undo log entries 1
query id 2154897539 rpushhost2 updating
UPDATE `rpush_notifications` SET processing = 0, delivered = 1, delivered_at = '2015-09-08 06:23:19' WHERE `rpush_notifications`.`id` IN (47324, 47325, 47326)
*** WE ROLL BACK TRANSACTION (2)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@shawzt looks like it works better, we have less records in ‘processing’ state but anyway we still have it for some reason…