-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix(goldfish): add tolerances to mismatches in the query-tee #20004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7db7154 to
1594935
Compare
07f32fd to
336918b
Compare
8b96826 to
6f5b89c
Compare
This change relocates response comparator logic to its own package to prevent cyclic imports and improve code organization. No functional changes.
Some results containing floating point numbers might have different hash values but the same effective value. This can come about because adding floating point numbers is not commutative
6f5b89c to
af34838
Compare
ashwanthgoli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall LGTM, left some minor suggestions
The short name is prefered as per the Package names Go blog entry
| if err == nil { | ||
| result.ComparisonStatus = goldfish.ComparisonStatusMatch | ||
| result.DifferenceDetails["tolerance_match"] = true | ||
| return result | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we should not return here as we update performance stats in difference details on line 82.
it would be also nice to capture the error in DifferenceDetails to understand why the comparator failed
What this PR does / why we need it:
When using
query-tee, it is possible for identical floating point data to be returned as different values from different cells. Floating point addition is not commutative so the result is dependent on the order that data is returned.These differences are recorded in goldfish as a mismatch.
This fix will reuse the threshold compare to treat the values in this special case as the same and report the values as matching (even when they have a different hash value).
In order to reuse the
ResponsesComparatorwithout cyclic dependencies, it has been factored into it's own packageWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.mdguide (required)featPRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.mddeprecated-config.yamlanddeleted-config.yamlfiles respectively in thetools/deprecated-config-checkerdirectory. Example PR