aboutsummaryrefslogtreecommitdiff
path: root/weed/server
diff options
context:
space:
mode:
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
}