Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-25216

PostgreSQL deadlock while updating template

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Server (S)
    • None

      Steps to reproduce:

      1. Open template, linked to big amount of hosts(all hosts in my case)
      2. Select new template with discovery rule in it
      3. Click "Update" button

      Result:

      Template update fails with deadlock detected.

      See screenshot...

      full error text:

       * pg_query(): Query failed: ERROR: deadlock detected DETAIL: Process 110258 waits for AccessExclusiveLock on tuple (4,38) of relation 17433 of database 16387; blocked by process 171456. Process 171456 waits for ShareLock on transaction 948895913; blocked by process 171417. Process 171417 waits for ShareLock on transaction 948890489; blocked by process 110258. HINT: See server log for query details. [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerTemplateUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CTemplate->update() → CTemplate->updateForce() → CHostGeneral->updateTemplates() → CHostGeneral::linkTemplatesObjects() → CDiscoveryRule::linkTemplateObjects() → CTriggerGeneral->syncTemplates() → CTriggerGeneral->inherit() → CTriggerGeneral->createReal() → CTriggerGeneral->implode_expressions() → DB::reserveIds() → DBselect() → pg_query() in include/db.inc.php:249]
       * Error in query [SELECT nextid FROM ids WHERE table_name='functions' AND field_name='functionid' FOR UPDATE] [ERROR: deadlock detected DETAIL: Process 110258 waits for AccessExclusiveLock on tuple (4,38) of relation 17433 of database 16387; blocked by process 171456. Process 171456 waits for ShareLock on transaction 948895913; blocked by process 171417. Process 171417 waits for ShareLock on transaction 948890489; blocked by process 110258. HINT: See server log for query details.]
       * pg_query(): Query failed: ERROR: current transaction is aborted, commands ignored until end of transaction block [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerTemplateUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CTemplate->update() → CTemplate->updateForce() → CHostGeneral->updateTemplates() → CHostGeneral::linkTemplatesObjects() → CDiscoveryRule::linkTemplateObjects() → CTriggerGeneral->syncTemplates() → CTriggerGeneral->inherit() → CTriggerGeneral->createReal() → CTriggerGeneral->implode_expressions() → DB::reserveIds() → DBexecute() → pg_query() in include/db.inc.php:368]
       * Error in query [SELECT nextid FROM ids WHERE table_name='functions' AND field_name='functionid' FOR UPDATE] [ERROR: current transaction is aborted, commands ignored until end of transaction block]
       * Your database is not working properly. Please wait a few minutes and try to repeat this action. If the problem still persists, please contact system administrator. The problem might be caused by long running transaction or row level lock accomplished by your database management system.
      

      In the postgresql logs I see the same error.

      I've  tried for several times with the same result.

       

            zabbix.dev Zabbix Development Team
            artem.kh Artem
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: