mon: Never decrease op counters on OSD restart or master change #190

Open
koolkhel wants to merge 2 commits from koolkhel/vitastor:mon-monotonic-stats into master

2 Commits

Author SHA1 Message Date
d3b65be392 mon: Never decrease per-inode op counters on OSD restart or master change
vitastor_image_stat_count/usec/bytes were a sum of absolute OSD inode
counters over up OSDs, so they went down when an OSD was down or
restarted, and rate() showed a false spike on image and pool graphs.

Sum the growth of OSD inode counters instead, like the total op
counters, starting from /inode/stats saved by the previous master.
Forget the totals of an inode together with its stats when it is
deleted.
2026-11-25 20:22:02 +03:00
81bc782c84 mon: Never decrease total op counters on OSD restart or master change
vitastor_stat_count/usec/bytes are exported as Prometheus counters, but
they were a sum of absolute OSD counters. The sum went down when an OSD
was down or restarted (its counters start from zero), and a new monitor
master published an empty and then a partial sum until every OSD had
reported twice. rate() takes every such drop for a counter reset and
shows a spike of the whole accumulated value.

Sum the growth of OSD counters instead, starting from the totals saved
in /stats, so that a new master continues them. Operations done between
the old master's last update and the new master's first look at an OSD
are not counted.
2026-11-25 20:20:30 +03:00