Fix no more writable volumes by delay judgment (#4548)

* fix nomore writables volumes while disk free space is sufficient by time delay

* reset

---------

Co-authored-by: wang wusong <wangwusong@virtaitech.com>
This commit is contained in:
wusong
2023-06-06 01:17:21 +08:00
committed by GitHub
parent fb4b61036c
commit 26f15d0079
22 changed files with 1277 additions and 1103 deletions

View File

@@ -2,15 +2,17 @@ package weed_server
import (
"context"
"github.com/seaweedfs/seaweedfs/weed/stats"
"strconv"
"time"
"github.com/seaweedfs/seaweedfs/weed/stats"
"runtime"
"github.com/prometheus/procfs"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"runtime"
)
var numCPU = runtime.NumCPU()
@@ -81,7 +83,7 @@ func (vs *VolumeServer) VacuumVolumeCommit(ctx context.Context, req *volume_serv
resp := &volume_server_pb.VacuumVolumeCommitResponse{}
readOnly, err := vs.store.CommitCompactVolume(needle.VolumeId(req.VolumeId))
readOnly, volumeSize, err := vs.store.CommitCompactVolume(needle.VolumeId(req.VolumeId))
if err != nil {
glog.Errorf("failed commit volume %d: %v", req.VolumeId, err)
@@ -90,6 +92,7 @@ func (vs *VolumeServer) VacuumVolumeCommit(ctx context.Context, req *volume_serv
}
stats.VolumeServerVacuumingCommitCounter.WithLabelValues(strconv.FormatBool(err == nil)).Inc()
resp.IsReadOnly = readOnly
resp.VolumeSize = uint64(volumeSize)
return resp, err
}