Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-11636

Deadlock when adding many releases at once

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Edit system
    • None

      I have prepared multiple seeded releases and when trying to submit them one after another in quick succession I'm greeted by deadlocks:

      40P01 DBD::Pg::st execute failed: ERROR: deadlock detected DETAIL: Process 21581 waits for ShareLock on transaction 872242320; blocked by process 21589. Process 21589 waits for ShareLock on transaction 872242326; blocked by process 21581. HINT: See server log for query details. CONTEXT: while locking tuple (25564,41) in relation "artist_credit" SQL statement "SELECT ref_count FROM artist_credit WHERE id = 2618463 FOR UPDATE" PL/pgSQL function inc_ref_count(character varying,integer,integer) line 4 at EXECUTE SQL statement "SELECT inc_ref_count('artist_credit', NEW.artist_credit, 1)" PL/pgSQL function a_ins_release_group() line 3 at PERFORM [for Statement "INSERT INTO release_group (gid,type,artist_credit,name,comment) VALUES (?,?,?,?,?) RETURNING id" with ParamValues: 1='96630377-fc63-457c-aa25-a1625add8854', 2='2', 3='2618463', 4='Sph', 5='']
      
      40P01 DBD::Pg::st execute failed: ERROR: deadlock detected DETAIL: Process 21413 waits for ShareLock on transaction 872242345; blocked by process 21584. Process 21584 waits for ShareLock on transaction 872242351; blocked by process 21413. HINT: See server log for query details. CONTEXT: while locking tuple (25564,41) in relation "artist_credit" SQL statement "SELECT ref_count FROM artist_credit WHERE id = 2618463 FOR UPDATE" PL/pgSQL function inc_ref_count(character varying,integer,integer) line 4 at EXECUTE SQL statement "SELECT inc_ref_count('artist_credit', NEW.artist_credit, 1)" PL/pgSQL function a_ins_release() line 4 at PERFORM [for Statement "INSERT INTO release (release_group,comment,barcode,name,script,packaging,gid,language,status,artist_credit) VALUES (?,?,?,?,?,?,?,?,?,?) RETURNING id" with ParamValues: 1='2674536', 2='', 3='053000293095', 4='Ai Suppo Kizs', 5='28', 6='7', 7='a504ede4-43ae-427a-a334-1aa865e3d44e', 8='198', 9='1', 10='2618463']
      
      40P01 DBD::Pg::st execute failed: ERROR: deadlock detected DETAIL: Process 21590 waits for ShareLock on transaction 872242317; blocked by process 21586. Process 21586 waits for ShareLock on transaction 872242311; blocked by process 21590. HINT: See server log for query details. CONTEXT: while locking tuple (25564,41) in relation "artist_credit" SQL statement "SELECT ref_count FROM artist_credit WHERE id = 2618463 FOR UPDATE" PL/pgSQL function inc_ref_count(character varying,integer,integer) line 4 at EXECUTE SQL statement "SELECT inc_ref_count('artist_credit', NEW.artist_credit, 1)" PL/pgSQL function a_ins_release_group() line 3 at PERFORM [for Statement "INSERT INTO release_group (comment,gid,type,name,artist_credit) VALUES (?,?,?,?,?) RETURNING id" with ParamValues: 1='', 2='53f31f8e-e830-4253-9fb9-35f50733752a', 3='2', 4='Demo Yo Naido', 5='2618463']
      

            Unassigned Unassigned
            chaban chaban
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                Version Package