-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[8.x] OsStats must be lenient with bad data from older nodes #73610
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
[8.x] OsStats must be lenient with bad data from older nodes #73610
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
rjernst
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.
The approach seems good to me, but can you please link the relevant PRs?
| assert this.free >= 0 : "expected free swap to be positive, got: " + total; | ||
| } else { | ||
| // If we have a node in the cluster without the bug fix for | ||
| // negative memory values, we need to coerce negative values to 0 here. |
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.
It would be good to have a link here to the relevant PR that added coercion, so a reader can verify the 7.8 boundary.
| assert free >= 0 : "expected free memory to be positive, got: " + total; | ||
| } else { | ||
| // If we have a node in the cluster without the bug fix for | ||
| // negative memory values, we need to coerce negative values to 0 here. |
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.
It would be good to have a link here to the relevant PR that added coercion, so a reader can verify the 7.2 boundary.
|
@elasticmachine run elasticsearch-ci/bwc (the error was a timeout on an unrelated test) |
rjernst
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.
LGTM
We've had a series of bug fixes for cases where an
OsProbegives negative values, most often just-1, to theOsStatsclass. We added assertions to catch cases where we were initializingOsStatswith bad values. Unfortunately, these fixes turned to not be backwards-compatible. In this commit, we simply coerce bad values to 0 when data is coming from nodes that don't have the relevant bug fixes.Relevant PRs:
Fixes #73459