acts-as-taggable-on: PG TR Deadlock Detected after addition of taggings_count
Just upgraded to v3.1.1 and I’m seeing a deadlock. I have 25 sidekiq (threaded) workers running and importing data. Each process is creating many tags.
WARN: PG::TRDeadlockDetected: ERROR: deadlock detected
DETAIL: Process 2546 waits for ShareLock on transaction 258000; blocked by process 2547.
Process 2547 waits for ExclusiveLock on tuple (74,46) of relation 45545 of database 19986; blocked by process 2554.
Process 2554 waits for ShareLock on transaction 257999; blocked by process 2546.
HINT: See server log for query details.
: UPDATE "tags" SET "taggings_count" = COALESCE("taggings_count", 0) - 1 WHERE "tags"."id" = 5849
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 19 (3 by maintainers)
This fixed issue for us. The cons of that are that we limit the number of threads but we don’t experience the deadlock again. https://github.com/mperham/sidekiq/wiki/Ent-Rate-Limiting#concurrent
… somehow I’m still getting deadlock errors even after setting
ActsAsTaggableOn.tags_counter = false
inside my sidekiq jobmy job looks something like this:
Am I doing it wrong?