aboutsummaryrefslogtreecommitdiff
path: root/weed/server
diff options
context:
space:
mode:
authorwusong <75450248+wusongANKANG@users.noreply.github.com>2023-06-06 01:17:21 +0800
committerGitHub <noreply@github.com>2023-06-05 10:17:21 -0700
commit26f15d007977bd048c1908d9b2e11d512699b007 (patch)
treefc789376e6b554bddd5393fcf0f357c8ab73e83d /weed/server
parentfb4b61036cd6389b18efc5343b766b1c5512ad1c (diff)
downloadseaweedfs-26f15d007977bd048c1908d9b2e11d512699b007.tar.xz
seaweedfs-26f15d007977bd048c1908d9b2e11d512699b007.zip
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>
Diffstat (limited to 'weed/server')
-rw-r--r--weed/server/volume_grpc_admin.go2
-rw-r--r--weed/server/volume_grpc_vacuum.go9
2 files changed, 8 insertions, 3 deletions
diff --git a/weed/server/volume_grpc_admin.go b/weed/server/volume_grpc_admin.go
index 7ba9f72c9..b4748c276 100644
--- a/weed/server/volume_grpc_admin.go
+++ b/weed/server/volume_grpc_admin.go
@@ -237,7 +237,9 @@ func (vs *VolumeServer) VolumeStatus(ctx context.Context, req *volume_server_pb.
return nil, fmt.Errorf("not found volume id %d", req.VolumeId)
}
+ volumeSize, _, _ := v.DataBackend.GetStat()
resp.IsReadOnly = v.IsReadOnly()
+ resp.VolumeSize = uint64(volumeSize)
return resp, nil
}
diff --git a/weed/server/volume_grpc_vacuum.go b/weed/server/volume_grpc_vacuum.go
index 296760ba6..990611052 100644
--- a/weed/server/volume_grpc_vacuum.go
+++ b/weed/server/volume_grpc_vacuum.go
@@ -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
}