Skip to content

CA-408841: [XSI-1845] Enabling HA leads rrdd failure #6392

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ocaml/libs/xapi-rrd/lib/rrd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,16 @@ let ds_update rrd timestamp valuesandtransforms new_rrd =
plugin, correspondingly they all have the same timestamp.
Further refactoring is needed if timestamps per measurement are to be
introduced. *)
let first_ds_index, _ = valuesandtransforms.(0) in
let last_updated = rrd.rrd_dss.(first_ds_index).ds_last_updated in
let last_updated =
match Array.to_list valuesandtransforms with
| [] ->
(* If all dss in the current plugin are disabled, valuesandtransforms
will be empty. In this case, will use the whole last_updated.
Otherwise, use the per-datasource last_updated. *)
rrd.last_updated
| (first_ds_index, _) :: _ ->
rrd.rrd_dss.(first_ds_index).ds_last_updated
in
let interval = timestamp -. last_updated in
(* Work around the clock going backwards *)
let interval = if interval < 0. then 5. else interval in
Expand Down
Loading