From fec88e64eb7c33e73b2e6da2afa99d68db56e495 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Tue, 26 Nov 2024 21:02:45 +0500 Subject: [PATCH] [master] update LastLeaderChangeTime for hashicorp raft (#6292) --- weed/server/master_server.go | 1 - weed/server/raft_hashicorp.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/server/master_server.go b/weed/server/master_server.go index e3b5deea6..fa45053dd 100644 --- a/weed/server/master_server.go +++ b/weed/server/master_server.go @@ -191,7 +191,6 @@ func (ms *MasterServer) SetRaftServer(raftServer *RaftServer) { } else if raftServer.RaftHashicorp != nil { ms.Topo.HashicorpRaft = raftServer.RaftHashicorp raftServerName = ms.Topo.HashicorpRaft.String() - // TODO fix this for hashicorp raft ms.Topo.LastLeaderChangeTime = time.Now() } ms.Topo.RaftServerAccessLock.Unlock() diff --git a/weed/server/raft_hashicorp.go b/weed/server/raft_hashicorp.go index c019082f0..0c6a72d6f 100644 --- a/weed/server/raft_hashicorp.go +++ b/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) prevLeader = leader + s.topo.LastLeaderChangeTime = time.Now() } } }