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

Database deadlock on add artist edits

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Edit system
    • Labels:
      None

      Description

      Case 1:

      ```
      Error:

      Caught exception in MusicBrainz::Server::Controller::Artist->create "The edit could not be created. Exception (MusicBrainz::Server::Exceptions::DatabaseError): 40P01 DBD::Pg::st execute failed: ERROR:  deadlock detected
      LINE 1: INSERT INTO l_artist_artist (link,entity0,entity1,entity0_cr...
                          ^
      DETAIL:  Process 534 waits for RowExclusiveLock on relation 438155 of database 436372; blocked by process 443.
      Process 443 waits for RowExclusiveLock on relation 437372 of database 436372; blocked by process 534.
      HINT:  See server log for query details. [for Statement "INSERT INTO l_artist_artist (link,entity0,entity1,entity0_credit,link_order,entity1_credit) VALUES (?,?,?,?,?,?) RETURNING id" with ParamValues: 1='31118', 2='1541768', 3='1651202', 4='', 5='0', 6=''] at lib/MusicBrainz/Server/Controller.pm line 106.
       at lib/Sql.pm line 334.
       at lib/Sql.pm line 334."
      Stack trace:
      line
      line
      line
      line
      line
      Time: 2018-04-20 02:07:21 UTC

      Host: 9788d7166d08

      Interface language: en

      URL: https://beta.musicbrainz.org/dialog?path=%2Fartist%2Fcreate

      Request data:

      $VAR1 = {
                'body_parameters' => {
                                       'edit-artist.area_id' => '107',
                                       'edit-artist.period.end_date.day' => '',
                                       'edit-artist.isni_codes.0' => '',
                                       'edit-artist.edit_note' => 'http://tadakoi.tv/chara02.html',
                                       'edit-artist.begin_area.name' => '',
                                       'edit-artist.period.begin_date.day' => '',
                                       'edit-artist.rel.0.entity0_credit' => '',
                                       'edit-artist.rel.0.period.begin_date.day' => '',
                                       'edit-artist.period.begin_date.month' => '',
                                       'edit-artist.name' => "\x{30c6}\x{30ec}\x{30b5}\x{30fb}\x{30ef}\x{30fc}\x{30b0}\x{30ca}\x{30fc}",
                                       'edit-artist.ipi_codes.0' => '',
                                       'edit-artist.rel.0.target' => '32ad269a-57d1-4630-8cae-30928ac1b64e',
                                       'edit-artist.rel.0.period.end_date.day' => '',
                                       'edit-artist.rel.0.period.begin_date.year' => '',
                                       'edit-artist.begin_area_id' => '',
                                       'edit-artist.type_id' => '4',
                                       'edit-artist.area.gid' => '2db42837-c832-3c27-b4a3-08198f75693c',
                                       'edit-artist.rel.0.period.ended' => '0',
                                       'edit-artist.rel.0.entity1_credit' => '',
                                       'edit-artist.sort_name' => 'Teresa Wagner',
                                       'edit-artist.rel.0.period.begin_date.month' => '',
                                       'edit-artist.area.name' => 'Japan',
                                       'edit-artist.period.begin_date.year' => '',
                                       'edit-artist.period.end_date.year' => '',
                                       'edit-artist.period.end_date.month' => '',
                                       'edit-artist.rel.0.period.end_date.year' => '',
                                       'edit-artist.rel.0.period.end_date.month' => '',
                                       'edit-artist.end_area_id' => '',
                                       'edit-artist.end_area.name' => '',
                                       'edit-artist.rel.0.backward' => '1',
                                       'edit-artist.gender_id' => '2',
                                       'edit-artist.rel.0.link_type_id' => '292',
                                       'edit-artist.begin_area.gid' => '',
                                       'edit-artist.comment' => "\x{591a}\x{7530}\x{304f}\x{3093}\x{306f}\x{604b}\x{3092}\x{3057}\x{306a}\x{3044}",
                                       'edit-artist.end_area.gid' => ''
                                     },
                'query_parameters' => {
                                        'path' => '/artist/create'
                                      }
              };
      ```
       

       

       

      Case 2:

      ```
       Error:

      Caught exception in MusicBrainz::Server::Controller::Artist->create "The edit could not be created. Exception (MusicBrainz::Server::Exceptions::DatabaseError): 40P01 DBD::Pg::st execute failed: ERROR:  deadlock detected
      LINE 1: INSERT INTO l_artist_artist (link_order,entity1,entity0,link...
                          ^
      DETAIL:  Process 669 waits for RowExclusiveLock on relation 438155 of database 436372; blocked by process 443.
      Process 443 waits for RowExclusiveLock on relation 437372 of database 436372; blocked by process 669.
      HINT:  See server log for query details. [for Statement "INSERT INTO l_artist_artist (link_order,entity1,entity0,link,entity0_credit,entity1_credit) VALUES (?,?,?,?,?,?) RETURNING id" with ParamValues: 1='0', 2='1651203', 3='1541768', 4='31118', 5='', 6=''] at lib/MusicBrainz/Server/Controller.pm line 106.
       at lib/Sql.pm line 334.
       at lib/Sql.pm line 334."
      Stack trace:
      line
      line
      line
      line
      Time: 2018-04-20 02:09:22 UTC

      Host: 3e32036de7df

      Interface language: en

      URL: https://beta.musicbrainz.org/dialog?path=%2Fartist%2Fcreate

      Request data:

      $VAR1 = {
                'query_parameters' => {
                                        'path' => '/artist/create'
                                      },
                'body_parameters' => {
                                       'edit-artist.period.end_date.day' => '',
                                       'edit-artist.edit_note' => 'http://tadakoi.tv/chara02.html',
                                       'edit-artist.begin_area_id' => '',
                                       'edit-artist.end_area.gid' => '',
                                       'edit-artist.period.begin_date.month' => '',
                                       'edit-artist.begin_area.name' => '',
                                       'edit-artist.period.end_date.month' => '',
                                       'edit-artist.rel.0.period.end_date.day' => '',
                                       'edit-artist.rel.0.entity1_credit' => '',
                                       'edit-artist.rel.0.entity0_credit' => '',
                                       'edit-artist.isni_codes.0' => '',
                                       'edit-artist.end_area_id' => '',
                                       'edit-artist.type_id' => '4',
                                       'edit-artist.rel.0.backward' => '1',
                                       'edit-artist.ipi_codes.0' => '',
                                       'edit-artist.rel.0.period.begin_date.day' => '',
                                       'edit-artist.comment' => "\x{591a}\x{7530}\x{304f}\x{3093}\x{306f}\x{604b}\x{3092}\x{3057}\x{306a}\x{3044}",
                                       'edit-artist.period.begin_date.year' => '',
                                       'edit-artist.begin_area.gid' => '',
                                       'edit-artist.rel.0.period.begin_date.month' => '',
                                       'edit-artist.end_area.name' => '',
                                       'edit-artist.rel.0.period.begin_date.year' => '',
                                       'edit-artist.period.begin_date.day' => '',
                                       'edit-artist.area_id' => '107',
                                       'edit-artist.rel.0.period.ended' => '0',
                                       'edit-artist.rel.0.target' => '32ad269a-57d1-4630-8cae-30928ac1b64e',
                                       'edit-artist.area.gid' => '2db42837-c832-3c27-b4a3-08198f75693c',
                                       'edit-artist.rel.0.link_type_id' => '292',
                                       'edit-artist.rel.0.period.end_date.year' => '',
                                       'edit-artist.period.end_date.year' => '',
                                       'edit-artist.area.name' => 'Japan',
                                       'edit-artist.name' => "\x{30c6}\x{30ec}\x{30b5}\x{30fb}\x{30ef}\x{30fc}\x{30b0}\x{30ca}\x{30fc}",
                                       'edit-artist.sort_name' => 'Teresa Wagner',
                                       'edit-artist.rel.0.period.end_date.month' => '',
                                       'edit-artist.gender_id' => '2'
                                     }
              };
      ```

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            yindesu Duke Yin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package