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
pull from: koolkhel/vitastor:mon-monotonic-stats
merge into: vitalif:master
vitalif:master
vitalif:primary-stickiness
vitalif:libvfn
vitalif:canceling
vitalif:immediate-repeering
vitalif:rdma-close-tcp
vitalif:use-degraded-writes
vitalif:fix-write-delete-flow
vitalif:openssl-3.0.12
vitalif:openssl-capture-secrets
vitalif:ignore-small-rdma-end
vitalif:encrypt-batch
vitalif:faster-peering-calc
vitalif:http-hello
vitalif:xxh3-bench
vitalif:create-user-etcd-based
vitalif:aesxts_streaming_nosupport
vitalif:refactor-heap-continue-write
vitalif:ston3lu-patch-0127
vitalif:rdma-credits
vitalif:heap-meta
vitalif:sendmsg-zc-no-more-error
vitalif:fix-clear-refs
vitalif:veeam-trick
vitalif:test-etcd-schizo
vitalif:test
vitalif:test1
vitalif:test2
vitalif:cow-meta
vitalif:kv-readahead
vitalif:qemu-fix-crash-idea
vitalif:eventloop-auto-init-trigger
vitalif:hugo-docs
vitalif:node-mutex-and-postpone
vitalif:check-writeback
vitalif:msgr-iothreads-v2
vitalif:antietcd
vitalif:rel-1.4
vitalif:test-fix-ec-unknown-state-51
vitalif:kv-update
vitalif:kv-debug
vitalif:hotfix-1.2.0
vitalif:rdma-simple-nodp
vitalif:zerocopy-tcp-send
vitalif:csi-staging
vitalif:hotfix-1.1.0
vitalif:hotfix-1.0.0
vitalif:fsync-feedback
vitalif:cached-reads
vitalif:qemu-send-loop
vitalif:test-double-alloc
vitalif:hier-failure-domains
vitalif:mon-self-restart
vitalif:epoch-deletions
vitalif:rdma-flow-control
vitalif:csi-use-vitastor-cli
vitalif:rdma-v2
vitalif:etcd-hide-base64
vitalif:lrc-matrix
vitalif:rm-left-on-dead
vitalif:nfs-proxy-old
vitalif:non-odp-rdma
vitalif:test-zctr
vitalif:separate-data-connections
vitalif:sec_osd_msgr
vitalif:test-assert
vitalif:nbd-vmsplice
vitalif:allow-etcd-address-option
vitalif:rdma-zerocopy
vitalif:rel-0.5
vitalif:openonload
vitalif:sync-io-test
vitalif:trace-sync
vitalif:trace-sqes
vitalif:test-submit-and-wait
vitalif:test-sq-poll
vitalif:blocking-uring-test
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "koolkhel/vitastor:mon-monotonic-stats"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
vitastor_stat_*andvitastor_image_stat_*are exported as Prometheus counters, but the monitor computed them as sums of absolute OSD counters, so they went down:rate()/increase()take every such drop for a counter reset and count the whole accumulated value as growth. A graph then shows a false spike for about the length of the rate window: thousands of ops per second on an idle cluster after one OSD restart, or several times the real load after a master change.The monitor now sums the growth of OSD counters instead (the whole current value when a counter went down, i.e. the OSD restarted), starting from the totals saved in
/statsand/inode/stats, so a new master continues the series. Rates (iops/bps/lat) are not changed./stats,vitastor_stat_*)./inode/stats,vitastor_image_stat_*). A separate commit, so it can be taken or left on its own.Trade-off: operations done between the old master's last update and the new master's first look at each OSD are not counted, so a graph shows a slightly low point around a master change instead of a spike.
Found: commit 1 was seen in a run on a test cluster:
rate()of the total op counter spiked after every monitor master change and after an OSD restart (on an idle cluster, one OSD restart took the total primary_write count from 488061 down to 303334). Commit 2 was found by reading the code only: the per-inode counters are summed the same way; the new unit test shows them going down when an OSD goes down, but it was not seen on a cluster.Tested:
node mon/test-stats.js(new): OSD down, OSD restart, master change. On master it fails at the OSD down step (the total and the per-inode counters drop by that OSD's value); with only commit 1, the per-inode check fails at the same step; with both commits it passes. eslint is clean.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.