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

Need to exception 'FOR UPDATE' query for API error handling.

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 2.0.18, 3.0.4
    • API (A)
    • mysql-5.1.73-5.el6, mariadb-5.5.47-1.el7

      "SELECT ~ FOR UPDATE" query need to exception handling - like 'DBSELECT_FOR_UPDATE_ERROR'

      Unfortunately, 'deadlock' error can happen ids table update via ZABBIX API with use multiple threads execute in mysql.

      The problem in this 'SELECT ~ FOR UPDATE" query cases,
      When a transaction rollback occurs due to a deadlock or lock wait timeout error, I didn't received any 'error' response from API.

      We have observed this error using 'trigger.update'.

      • Query in transactions >
        SELECT nextid FROM ids WHERE nodeid=0 AND table_name='functions' AND field_name='functionid' FOR UPDATE
        
      • SQL Error>
        "Deadlock found when trying to get lock; try restarting transaction"
        

      In Database : TRANSCTIONS_FAILED -> rollback
      API Response : triggerid (ERROR does not return)

      Source: frontends/php/include/classes/db/DB.php - reserveIds()

      Related issue:
      ZBX-11062 - API - Deadlock occurs when multiple API call processes with MySQL

            Unassigned Unassigned
            JKKim Kim Jongkwon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: