avoid duplicated volume directory

This commit is contained in:
guol-fnst
2022-05-16 10:41:18 +08:00
parent 8f103ae613
commit de6aa9cce8
16 changed files with 186 additions and 40 deletions

View File

@@ -2,9 +2,12 @@ package weed_server
import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/operation"
"os"
"syscall"
"time"
"github.com/chrislusf/seaweedfs/weed/operation"
"google.golang.org/grpc"
"github.com/chrislusf/seaweedfs/weed/pb"
@@ -116,6 +119,12 @@ func (vs *VolumeServer) doHeartbeat(masterAddress pb.ServerAddress, grpcDialOpti
doneChan <- err
return
}
if in.HasDuplicatedDirectory {
glog.Error("Shut Down Volume Server due to duplicated volume directory")
glog.V(0).Infof("send SIGINT to Volume Server")
p, _ := os.FindProcess(vs.pid)
p.Signal(syscall.SIGINT)
}
if in.GetVolumeSizeLimit() != 0 && vs.store.GetVolumeSizeLimit() != in.GetVolumeSizeLimit() {
vs.store.SetVolumeSizeLimit(in.GetVolumeSizeLimit())
if vs.store.MaybeAdjustVolumeMax() {