[ZBX-13766] Incorrect comparison of two numbers 17179869184 Created: 2018 Apr 19  Updated: 2024 Apr 10  Resolved: 2018 May 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.4.8
Fix Version/s: 3.0.17rc1, 3.4.9rc1, 4.0.0alpha6, 4.0 (plan)

Type: Incident report Priority: Critical
Reporter: Egupov Andrey Assignee: Sergejs Paskevics
Resolution: Fixed Votes: 0
Labels: evaluation, expressions, triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File dashboard.jpg     JPEG File item1.jpg     JPEG File latest_data.jpg     JPEG File trigger.jpg    
Team: Team C
Team: Team C
Sprint: Sprint 32, Sprint 33, Sprint 34
Story Points: 1

 Description   

Two items
first item
name test1
type zabbix trapper
key test1
type information unsigned int

second item
name test2
type zabbix trapper
key test2
type information unsigned int

trigger

{zabbix.test.eirc:test1.last()}>{zabbix.test.eirc:test2.last()}

The trigger is triggered, and indicates that the error, although the numbers are equal



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 19 ]

Here is what our documentation says about operator >:

More than. The operator is defined as:
A>B ⇔ (A>=B+0.000001)

For large numbers like yours B+0.000001 will be just B due to roundoff errors and A>B will basically transform into A>=B which may lead to confusion.

Comment by Egupov Andrey [ 2018 Apr 19 ]

In the version of 3.2, there is no such behavior. Although the documentation also says More than.

The operator is defined as:
A> B ⇔ (A> = B + 0.000001)

Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 19 ]

In the version of 3.2, there is no such behavior.

Really? I believe that piece of code hasn't been touched for years...

Comment by Egupov Andrey [ 2018 Apr 19 ]

Yes, specially checked.

Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 19 ]

Same values?

Comment by Egupov Andrey [ 2018 Apr 19 ]

Yes, I tested on 16 GB, 32 GB or higher (in bytes)

Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 19 ]

I've tested 16G > 16G in calculated item formula (it has the same logic as trigger expression) in 3.0 and it gave me 1 (would be PROBLEM in trigger).

Comment by Sergejs Paskevics [ 2018 Apr 19 ]

Implemented in /branches/dev/ZBX-13766

Comment by richlv [ 2018 Apr 20 ]

A rather confusing chain of comments. There are comments about the problem being non-reproducible, but then suddenly something is "implemented".

Comment by Glebs Ivanovskis (Inactive) [ 2018 Apr 20 ]

There are no hidden comments before "implemented".

Comment by Sergejs Paskevics [ 2018 Apr 23 ]

Implemented in:

  • 3.0.17rc1 in r79984, r80048;
  • 3.4.9rc1 in r79985, r80049;
  • pre-4.0.0alpha6 (trunk) in r79986, r80055;
Generated at Sat Apr 20 14:46:08 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.