Skip to content

Commit

Permalink
rrdd: do not half-update the metrics' datastructures of paused vms
Browse files Browse the repository at this point in the history
THe intent of the code was to either update the rrdi of the vm when it's
unpaused, or don't update it.
A recent patch unintendedly changed the behaviour to update the rrd regardless.

Signed-off-by: Pau Ruiz Safont <[email protected]>
  • Loading branch information
psafont committed Dec 24, 2024
1 parent 9eeb1f3 commit 08c15db
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions ocaml/xcp-rrdd/bin/rrdd/rrdd_monitor.ml
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,21 @@ let update_rrds uuid_domids paused_vms plugins_dss =
(* First, potentially update the rrd with any new default dss *)
match vm_rrd with
| Some rrdi ->
let updated_dss, rrd = merge_new_dss rrdi dss in
(* CA-34383: Memory updates from paused domains serve no useful
purpose. During a migrate such updates can also cause undesirable
discontinuities in the observed value of memory_actual. Hence, we
ignore changes from paused domains: *)
( if not (StringSet.mem vm_uuid paused_vms) then
let named_updates =
StringMap.map to_named_updates dss
in
Rrd.ds_update_named rrd
~new_rrd:(domid <> rrdi.domid) timestamp
named_updates
) ;
Some {rrd; dss= updated_dss; domid}
if StringSet.mem vm_uuid paused_vms then
Some rrdi
else
let named_updates =
StringMap.map to_named_updates dss
in
let dss, rrd = merge_new_dss rrdi dss in
Rrd.ds_update_named rrd
~new_rrd:(domid <> rrdi.domid) timestamp
named_updates ;
Some {rrd; dss; domid}
| None ->
debug "%s: Creating fresh RRD for VM uuid=%s"
__FUNCTION__ vm_uuid ;
Expand Down

0 comments on commit 08c15db

Please sign in to comment.