metric shows who is currently blocking the cluster or not (#3799)

* master_admin_lock Shows whether cluster is locked now or not
https://github.com/seaweedfs/seaweedfs/issues/3452

* fix metric MasterAdminLock
This commit is contained in:
Konstantin Lebedev
2022-10-08 01:26:29 +05:00
committed by GitHub
parent f8d3ff466d
commit 5db25a8f2a
3 changed files with 14 additions and 0 deletions

View File

@@ -307,6 +307,8 @@ func (ms *MasterServer) KeepConnected(stream master_pb.Seaweed_KeepConnectedServ
case <-ticker.C:
if !ms.Topo.IsLeader() {
stats.MasterRaftIsleader.Set(0)
stats.MasterAdminLock.Reset()
stats.MasterReplicaPlacementMismatch.Reset()
return ms.informNewLeader(stream)
} else {
stats.MasterRaftIsleader.Set(1)