mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-06 03:59:14 +00:00
194c8643c0
`build_metrics_summary` emitted a single metric entry for the local deployment with `online` hardcoded to `true` and `last_online` stamped with the current time, so `mc admin replicate status` reported "I am online" rather than whether the remote site was reachable. A peer could be down for minutes with replication failing while the status page stayed green, leaving operators with no signal that the link had dropped. Emit an entry for every peer instead, deriving `online` from the `reachable_peers` set the handler already computes by probing each peer, and take `total_downtime`/`last_online` from the replication heartbeat's existing `EpHealth` tracking. Node-local replication counters stay on the local entry so a two-site cluster does not double-count its own traffic. The new `BucketTargetSys::endpoint_health` accessor deliberately does not call `init_hc`: unlike `is_offline` it must not create health entries as a side effect, or merely rendering the status page would mark an unknown peer online. Failure counters (`Errors`) are unchanged and still read zero; that is a separate defect in the bucket-level statistics path and is not addressed here.