Skip to content

CA-408126 follow-up: Fix negative ds_min and RRD values in historical archives #6359

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

Conversation

last-genius
Copy link
Contributor

When reading RRD archives from XML, make sure ds_min is (almost never) negative, this will convert negative values to NaNs as well.

historical values to NaNs.*)
let min = float_of_string (get_el "min" i) in
let min =
if min < 0. && name <> "DCMI-power-reading" then
Copy link
Member

@psafont psafont Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not overjoyed about this specific hardcoding. Can this be done by type of aggregation (only gauges are allowed to be negative, for example)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, the DCMI example is a Gauge, but other Gauges were affected. I could add a quality-gate check that checks if no other datasources supply non-zero values to the ~min parameter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that will be necessary. Maybe we need some regression test to ensure out-of-range values don't enter the archives.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min is 0 for DCMI-power-reading though, and max is 65534. I don't see why it needs special casing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's min_float, which is apparently the smallest positive non-zero float value. Will drop this on Monday.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm. 'xe host-data-source-list' reports the wrong thing then, it reports it as 0 :(

Copy link
Contributor

@edwintorok edwintorok Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But anyway negative power usage doesn't make sense, so we should fix rrdp_dcmi.ml to use 0 as well in the plugin itself for the minimum, and then we can drop the hardcoding here.

… archives

When reading RRD archives from XML, make sure ds_min is never
negative, this will convert negative values to NaNs as well.

Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
@last-genius last-genius force-pushed the private/asultanov/CA-408126-historical-workaround branch from 74299ed to c1f02ed Compare March 17, 2025 08:06
@last-genius
Copy link
Contributor Author

Dropped the check for DCMI datasource, there actually aren't any negative datasources at all

@last-genius last-genius added this pull request to the merge queue Mar 17, 2025
Merged via the queue into xapi-project:master with commit fef11a3 Mar 17, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants