Browse Source
Fix "no more writable volumes" error when volume grows and master leader changed at the same time (#5771)
pull/5775/head
小羽
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
3 deletions
-
weed/server/master_grpc_server_volume.go
|
@ -27,9 +27,13 @@ func (ms *MasterServer) ProcessGrowRequest() { |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
option := req.Option |
|
|
|
|
|
vl := ms.Topo.GetVolumeLayout(option.Collection, option.ReplicaPlacement, option.Ttl, option.DiskType) |
|
|
|
|
|
|
|
|
if !ms.Topo.IsLeader() { |
|
|
if !ms.Topo.IsLeader() { |
|
|
//discard buffered requests
|
|
|
//discard buffered requests
|
|
|
time.Sleep(time.Second * 1) |
|
|
time.Sleep(time.Second * 1) |
|
|
|
|
|
vl.DoneGrowRequest() |
|
|
continue |
|
|
continue |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -42,9 +46,6 @@ func (ms *MasterServer) ProcessGrowRequest() { |
|
|
return !found |
|
|
return !found |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
option := req.Option |
|
|
|
|
|
vl := ms.Topo.GetVolumeLayout(option.Collection, option.ReplicaPlacement, option.Ttl, option.DiskType) |
|
|
|
|
|
|
|
|
|
|
|
// not atomic but it's okay
|
|
|
// not atomic but it's okay
|
|
|
if !found && vl.ShouldGrowVolumes(option) { |
|
|
if !found && vl.ShouldGrowVolumes(option) { |
|
|
filter.Store(req, nil) |
|
|
filter.Store(req, nil) |
|
|