mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-22 20:34:10 +08:00
support enable/disable vacuum (#4087)
* stop vacuum * suspend/resume vacuum * remove unused code * rename * rename param
This commit is contained in:
@@ -3,12 +3,13 @@ package weed_server
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/seaweedfs/raft"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/seaweedfs/raft"
|
||||
|
||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
|
||||
"github.com/seaweedfs/seaweedfs/weed/security"
|
||||
@@ -283,6 +284,20 @@ func (ms *MasterServer) VacuumVolume(ctx context.Context, req *master_pb.VacuumV
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (ms *MasterServer) DisableVacuum(ctx context.Context, req *master_pb.DisableVacuumRequest) (*master_pb.DisableVacuumResponse, error) {
|
||||
|
||||
ms.Topo.DisableVacuum()
|
||||
resp := &master_pb.DisableVacuumResponse{}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (ms *MasterServer) EnableVacuum(ctx context.Context, req *master_pb.EnableVacuumRequest) (*master_pb.EnableVacuumResponse, error) {
|
||||
|
||||
ms.Topo.EnableVacuum()
|
||||
resp := &master_pb.EnableVacuumResponse{}
|
||||
return resp, nil
|
||||
}
|
||||
|
||||
func (ms *MasterServer) VolumeMarkReadonly(ctx context.Context, req *master_pb.VolumeMarkReadonlyRequest) (*master_pb.VolumeMarkReadonlyResponse, error) {
|
||||
|
||||
if !ms.Topo.IsLeader() {
|
||||
|
Reference in New Issue
Block a user