Page MenuHomeSoftware Heritage

indexer storage: Deadlock in origin_extrinsic_metadata_add
Closed, MigratedEdits Locked

Description

https://sentry.softwareheritage.org/organizations/swh/issues/105240/?referrer=phabricator_plugin

DeadlockDetected: deadlock detected
DETAIL:  Process 1842336 waits for ShareLock on transaction 1051957280; blocked by process 64261.
Process 64261 waits for ShareLock on transaction 1051957281; blocked by process 1842336.
HINT:  See server log for query details.
CONTEXT:  while inserting index tuple (1972253,5) in relation "origin_extrinsic_metadata"
SQL statement "insert into origin_extrinsic_metadata (id, metadata, indexer_configuration_id, from_remd_id, metadata_tsvector, mappings)
    select id, metadata, indexer_con...
(5 additional frame(s) were not displayed)
...
  File "swh/indexer/storage/metrics.py", line 22, in d
    return f(*a, **kw)
  File "swh/indexer/storage/metrics.py", line 73, in d
    r = f(*a, **kw)
  File "swh/core/db/common.py", line 73, in _meth
    return meth(self, *args, db=db, cur=cur, **kwargs)
  File "swh/indexer/storage/__init__.py", line 671, in origin_extrinsic_metadata_add
    count = db.origin_extrinsic_metadata_add_from_temp(cur)
  File "swh/indexer/storage/db.py", line 403, in origin_extrinsic_metadata_add_from_temp
    cur.execute("select * from swh_origin_extrinsic_metadata_add()")