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

postgresql deadlock on items table when changing graph

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 2.0.6
    • Server (S)
    • RHEL 6.4
      PostgreSQL 9.2.4
      Dell R620, 16 cores, 64G, 8x15k SAS RAID 10
      NVPS: 1117.94

      I very recently migrated from 1.8.10 on MySQL to 2.0.5 on PostgreSQL and did not migrate any history or trend data. I only migrated the config. I enabled partitioning as detailed here https://www.zabbix.org/wiki/Docs/howto/zabbix2_postgresql_autopartitioning

      Afterwards, I attempted to copy the CPU Utilization graph from the Linux OS Template to my own template, but this caused a deadlock on the items table.

      I then attempted to manually reproduce this graph and could only save 4 items before producing this deadlock.

      After upgrading to 2.0.6 today, I was able to add a 5th item, but not a 6th. I set the DBSyncers down to 1, and it did not help.

      Below is the error produced in the Web UI:

      pg_query(): Query failed: ERROR: deadlock detected
      DETAIL: Process 26553 waits for ShareLock on transaction 160469663; blocked by process 16935.
      Process 16935 waits for ShareLock on transaction 160469658; blocked by process 26553.
      HINT: See server log for query details.
      CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."items" x WHERE "itemid" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x" [include/db.inc.php:511]
      Error in query [INSERT INTO graphs_items (gitemid,graphid,itemid,drawtype,sortorder,color,yaxisside,calc_fnc,type) VALUES ('26223','6992','82599','0','3','990099','0','2','0')] [ERROR: deadlock detected
      DETAIL: Process 26553 waits for ShareLock on transaction 160469663; blocked by process 16935.
      Process 16935 waits for ShareLock on transaction 160469658; blocked by process 26553.
      HINT: See server log for query details.
      CONTEXT: SQL statement "SELECT 1 FROM ONLY "public"."items" x WHERE "itemid" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x"]
      SQL statement execution has failed "INSERT INTO graphs_items (gitemid,graphid,itemid,drawtype,sortorder,color,yaxisside,calc_fnc,type) VALUES ('26223','6992','82599','0','3','990099','0','2','0')".

      Attached is the pgsql log corresponding to the above error.

      Forum: https://www.zabbix.com/forum/showthread.php?p=130638#post130638

            Unassigned Unassigned
            dale Dale Bewley
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: