[pve-devel] [PATCH pve-cluster v3] fix #6615: rrd: only return last entry if populated
Hannes Laimer
h.laimer at proxmox.com
Wed Aug 27 11:04:31 CEST 2025
RRD fetch can include the latest bucket before metrics are flushed,
resulting in entries with only a timestamp.
This now only returns the last entry if it contains at least one value.
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
v3, thanks @Dominik:
- only remove last entry if empty, not all empty ones
src/PVE/RRD.pm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/PVE/RRD.pm b/src/PVE/RRD.pm
index 8fe1927..5a23889 100644
--- a/src/PVE/RRD.pm
+++ b/src/PVE/RRD.pm
@@ -81,6 +81,12 @@ sub create_rrd_data {
push @$res, $entry;
}
+ # The newest bucket can still be empty right after a boundary.
+ if (@$res) {
+ # only contains 'time'
+ pop @$res if (scalar(keys %{$res->[-1]}) == 1);
+ }
+
return $res;
}
--
2.47.2
More information about the pve-devel
mailing list