Przeglądaj źródła

rafthttp: remove follower from leaderstats when it is removed from the cluster

Xiang Li 11 lat temu
rodzic
commit
58112c4d2d
1 zmienionych plików z 1 dodań i 0 usunięć
  1. 1 0
      rafthttp/transport.go

+ 1 - 0
rafthttp/transport.go

@@ -134,6 +134,7 @@ func (t *transport) RemovePeer(id types.ID) {
 	defer t.mu.Unlock()
 	t.peers[id].Stop()
 	delete(t.peers, id)
+	delete(t.leaderStats.Followers, id.String())
 }
 
 func (t *transport) UpdatePeer(id types.ID, urls []string) {