Browse Source
Check `ShouldGrowVolumes` before returning error in assign. (#5819)
revert-5819-patch-1
Ruoxi
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
1 additions and
1 deletions
-
weed/server/master_grpc_server_assign.go
|
@ -84,7 +84,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest |
|
|
|
|
|
|
|
|
for time.Now().Sub(startTime) < maxTimeout { |
|
|
for time.Now().Sub(startTime) < maxTimeout { |
|
|
fid, count, dnList, shouldGrow, err := ms.Topo.PickForWrite(req.Count, option, vl) |
|
|
fid, count, dnList, shouldGrow, err := ms.Topo.PickForWrite(req.Count, option, vl) |
|
|
if shouldGrow && !vl.HasGrowRequest() { |
|
|
|
|
|
|
|
|
if shouldGrow && !vl.HasGrowRequest() && vl.ShouldGrowVolumes(option) { |
|
|
// if picked volume is almost full, trigger a volume-grow request
|
|
|
// if picked volume is almost full, trigger a volume-grow request
|
|
|
if ms.Topo.AvailableSpaceFor(option) <= 0 { |
|
|
if ms.Topo.AvailableSpaceFor(option) <= 0 { |
|
|
return nil, fmt.Errorf("no free volumes left for " + option.String()) |
|
|
return nil, fmt.Errorf("no free volumes left for " + option.String()) |
|
|