Sfoglia il codice sorgente

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

Xiang Li 11 anni fa
parent
commit
58112c4d2d
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  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) {