Browse Source

remove .vif files

pull/1189/head
Chris Lu 5 years ago
parent
commit
df636e4c14
  1. 9
      weed/server/volume_grpc_erasure_coding.go

9
weed/server/volume_grpc_erasure_coding.go

@ -173,6 +173,7 @@ func (vs *VolumeServer) VolumeEcShardsDelete(ctx context.Context, req *volume_se
// check whether to delete the .ecx and .ecj file also // check whether to delete the .ecx and .ecj file also
hasEcxFile := false hasEcxFile := false
hasIdxFile := false
existingShardCount := 0 existingShardCount := 0
bName := filepath.Base(baseFilename) bName := filepath.Base(baseFilename)
@ -186,6 +187,10 @@ func (vs *VolumeServer) VolumeEcShardsDelete(ctx context.Context, req *volume_se
hasEcxFile = true hasEcxFile = true
continue continue
} }
if fileInfo.Name() == bName+".idx" {
hasIdxFile = true
continue
}
if strings.HasPrefix(fileInfo.Name(), bName+".ec") { if strings.HasPrefix(fileInfo.Name(), bName+".ec") {
existingShardCount++ existingShardCount++
} }
@ -200,6 +205,10 @@ func (vs *VolumeServer) VolumeEcShardsDelete(ctx context.Context, req *volume_se
return nil, err return nil, err
} }
} }
if !hasIdxFile {
// .vif is used for ec volumes and normal volumes
os.Remove(baseFilename + ".vif")
}
return &volume_server_pb.VolumeEcShardsDeleteResponse{}, nil return &volume_server_pb.VolumeEcShardsDeleteResponse{}, nil
} }

Loading…
Cancel
Save