mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-24 16:53:14 +08:00
master: broadcast new volume locations to clients to avoid possible racing condition
fix https://github.com/chrislusf/seaweedfs/issues/3220
This commit is contained in:
@@ -52,8 +52,13 @@ func (ms *MasterServer) ProcessGrowRequest() {
|
||||
go func() {
|
||||
glog.V(1).Infoln("starting automatic volume grow")
|
||||
start := time.Now()
|
||||
_, err := ms.vg.AutomaticGrowByType(req.Option, ms.grpcDialOption, ms.Topo, req.Count)
|
||||
newVidLocations, err := ms.vg.AutomaticGrowByType(req.Option, ms.grpcDialOption, ms.Topo, req.Count)
|
||||
glog.V(1).Infoln("finished automatic volume grow, cost ", time.Now().Sub(start))
|
||||
if err == nil {
|
||||
for _, newVidLocation := range newVidLocations {
|
||||
ms.broadcastToClients(&master_pb.KeepConnectedResponse{VolumeLocation: newVidLocation})
|
||||
}
|
||||
}
|
||||
vl.DoneGrowRequest()
|
||||
|
||||
if req.ErrCh != nil {
|
||||
|
||||
Reference in New Issue
Block a user