Browse Source

[master] update LastLeaderChangeTime for hashicorp raft (#6292)

pull/6299/head
Konstantin Lebedev 4 weeks ago
committed by GitHub
parent
commit
fec88e64eb
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      weed/server/master_server.go
  2. 1
      weed/server/raft_hashicorp.go

1
weed/server/master_server.go

@ -191,7 +191,6 @@ func (ms *MasterServer) SetRaftServer(raftServer *RaftServer) {
} else if raftServer.RaftHashicorp != nil { } else if raftServer.RaftHashicorp != nil {
ms.Topo.HashicorpRaft = raftServer.RaftHashicorp ms.Topo.HashicorpRaft = raftServer.RaftHashicorp
raftServerName = ms.Topo.HashicorpRaft.String() raftServerName = ms.Topo.HashicorpRaft.String()
// TODO fix this for hashicorp raft
ms.Topo.LastLeaderChangeTime = time.Now() ms.Topo.LastLeaderChangeTime = time.Now()
} }
ms.Topo.RaftServerAccessLock.Unlock() ms.Topo.RaftServerAccessLock.Unlock()

1
weed/server/raft_hashicorp.go

@ -78,6 +78,7 @@ func (s *RaftServer) monitorLeaderLoop(updatePeers bool) {
} }
glog.V(0).Infof("is leader %+v change event: %+v => %+v", isLeader, prevLeader, leader) glog.V(0).Infof("is leader %+v change event: %+v => %+v", isLeader, prevLeader, leader)
prevLeader = leader prevLeader = leader
s.topo.LastLeaderChangeTime = time.Now()
} }
} }
} }

Loading…
Cancel
Save