-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
7.0.18
-
None
Steps to reproduce:
- (any host) Click on "Create item".
- Give "Key" any value ("xxx" will do).
- "Type of information": Text.
- Go to tab "Preprocessing".
- Add "Discard unchanged".
- Click on "Test all steps".
- Field "Value": 000000050000002900000019
- Field "Previous value": 000000050000002900000012
- 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