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

Item preprocessing: implicit conversion of string to double leads to problem due to lack of double precision

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 7.0.18
    • Proxy (P), Server (S)
    • None

      Steps to reproduce:

      1. (any host) Click on "Create item".
      2. Give "Key" any value ("xxx" will do).
      3. "Type of information": Text.
      4. Go to tab "Preprocessing".
      5. Add "Discard unchanged".
      6. Click on "Test all steps".
      7. Field "Value": 000000050000002900000019
      8. Field "Previous value": 000000050000002900000012
      9. Field: "Prev. time": now-42

      Result:

      No value, i.e. "Discard unchanged" discarded the value.

      Expected:

      https://www.zabbix.com/documentation/7.0/en/manual/config/items/preprocessing#discardunchanged clearly states: "Discard a value if it has not changed." The value has changed, so I'm expecting value "000000050000002900000019", since "000000050000002900000019" != "000000050000002900000012"

       

       

      I did some research: src/libs/zbxvariant/variant.c seems to be the culprit, function zbx_variant_compare(value1, value2) to be precise. Zabbix tries to upgrade the strings to doubles, and succeeds. However, a double has finite precision. In the above case, a double does NOT have enough precision. See also my forum post at https://www.zabbix.com/forum/zabbix-help/507511-preprocessing-an-item-how-to-force-string-type-before-discard

       

      Note: my strings are actually PostgreSQL WAL archives names, and the archive after "000000050000002900000019" is "00000005000000290000001A". Comparing values "000000050000002900000019" and "00000005000000290000001A" does not lead to problems, since Zabbix cannot upgrade the latter to a double because of the letter 'A', and falls back to string matching.

       

       

      Somehow, I guess this bug will be "won't fix"/"can't fix". If so, please do update the documentation, for example by expanding the "Comments" section in https://www.zabbix.com/documentation/7.0/en/manual/config/items/preprocessing#discardunchanged and https://www.zabbix.com/documentation/7.0/en/manual/config/items/preprocessing#discardwithheartbeat

            zabbix.support Zabbix Support Team
            Gammuts Bart Dopheide
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: