fix naming convention

notify volume server of duplicate directoris
improve searching efficiency
This commit is contained in:
guol-fnst
2022-05-17 14:51:01 +08:00
committed by guol-fnst
parent 076595fbdd
commit b12944f9c6
7 changed files with 648 additions and 637 deletions

View File

@@ -118,8 +118,16 @@ 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")
if len(in.DuplicatedUuids) > 0 {
var duplictedDir []string
for _, loc := range vs.store.Locations {
for _, uuid := range in.DuplicatedUuids {
if uuid == loc.DirectoryUuid {
duplictedDir = append(duplictedDir, loc.Directory)
}
}
}
glog.Errorf("Shut down Volume Server due to duplicated volume directories: %v", duplictedDir)
os.Exit(1)
}
if in.GetVolumeSizeLimit() != 0 && vs.store.GetVolumeSizeLimit() != in.GetVolumeSizeLimit() {