jhu-idc / iDC-general

Contains non-code-base specific tickets relating to the Islandora8 for Digital Collection project
0 stars 0 forks source link

SQLState deadlock seen on occasion in development environment #446

Open bseeger opened 2 years ago

bseeger commented 2 years ago

This has been seen in the development environment. This has NOT been seen in the cloud environments yet, so we are not sure how big of a deal this is yet.

Sometimes this error will be found in the Drupal log (or statements like it - main part is that it's happening when updating the cache_entity table):

172.19.0.7 - - [11/Nov/2021:20:08:46 +0000] "GET /migrate_source_ui HTTP/1.1" 200 81587 "https://islandora-idc.traefik.me/batch?id=537&op=start" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36" "172.19.0.14"
NOTICE: PHP message: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: "SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: INSERT INTO "cache_entity" ("cid", "expire", "created", "tags", "checksum", "data", "serialized") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6) ON DUPLICATE KEY UPDATE "cid" = VALUES("cid"), "expire" = VALUES("expire"), "created" = VALUES("created"), "tags" = VALUES("tags"), "checksum" = VALUES("checksum"), "data" = VALUES("data"), "serialized" = VALUES("serialized"); Array
(
    [:db_insert_placeholder_0] => values:file:590
    [:db_insert_placeholder_1] => -1
    [:db_insert_placeholder_2] => 1636661326.852
    [:db_insert_placeholder_3] => entity_field_info file_values
    [:db_insert_placeholder_4] => 1749
    [:db_insert_placeholder_5] => O:23:"Drupal\file\Entity\File":28:{s:9:"
2021/11/11 20:08:46 [error] 835#835: *825 FastCGI sent in stderr: "PHP message: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: "SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: INSERT INTO "cache_entity" ("cid", "expire", "created", "tags", "checksum", "data", "serialized") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6) ON DUPLICATE KEY UPDATE "cid" = VALUES("cid"), "expire" = VALUES("expire"), "created" = VALUES("created"), "tags" = VALUES("tags"), "checksum" = VALUES("checksum"), "data" = VALUES("data"), "serialized" = VALUES("serialized"); Array
(
    [:db_insert_placeholder_0] => values:file:590
    [:db_insert_placeholder_1] => -1
    [:db_insert_placeholder_2] => 1636661326.852
    [:db_insert_placeholder_3] => entity_field_info file_values
    [:db_insert_placeholder_4] => 1749
    [:db_insert_placeholder_5] => O:23:"Drupal\file\Entity\File":28:{s:9:"" while reading response header from upstream, client: 172.19.0.7, server: drupal, request: "PUT /node/57/media/image/19 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm7/php-fpm7.sock:", host: "islandora-idc.traefik.me"

The system seems to recover okay, however, but if it happens when the CI system is running the tests will fail because they hit timeouts before the system recovers.

Turns out it's an old an known issue:

Right now we are opting to not do anything about it, but are noting the issue and some resources we might want to use to solve it if we need to.

bseeger commented 2 years ago

noting: https://www.drupal.org/node/1952972