Browse Source

master: avoid repeated leader redirection

fix https://github.com/chrislusf/seaweedfs/issues/2146
pull/2150/head
Chris Lu 4 years ago
parent
commit
d474ce6fe3
  1. 5
      weed/topology/topology.go

5
weed/topology/topology.go

@ -70,6 +70,11 @@ func (t *Topology) IsLeader() bool {
if t.RaftServer.State() == raft.Leader { if t.RaftServer.State() == raft.Leader {
return true return true
} }
if leader, err := t.Leader(); err == nil {
if t.RaftServer.Name() == leader {
return true
}
}
} }
return false return false
} }

Loading…
Cancel
Save