aboutsummaryrefslogtreecommitdiff
path: root/weed/server/volume_grpc_erasure_coding.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-01-03 12:46:39 -0800
committerChris Lu <chris.lu@gmail.com>2020-01-03 12:46:42 -0800
commitdf636e4c14e28603215a7f7b88ed6e8803d5381b (patch)
tree131ee30b03f9d5fccd6be38f963253d6948b3943 /weed/server/volume_grpc_erasure_coding.go
parenta057cd6c6135847c12de538879ca418ca875096d (diff)
downloadseaweedfs-df636e4c14e28603215a7f7b88ed6e8803d5381b.tar.xz
seaweedfs-df636e4c14e28603215a7f7b88ed6e8803d5381b.zip
remove .vif files
Diffstat (limited to 'weed/server/volume_grpc_erasure_coding.go')
-rw-r--r--weed/server/volume_grpc_erasure_coding.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go
index 4bca9948e..67efc0f6d 100644
--- a/weed/server/volume_grpc_erasure_coding.go
+++ b/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
hasEcxFile := false
+ hasIdxFile := false
existingShardCount := 0
bName := filepath.Base(baseFilename)
@@ -186,6 +187,10 @@ func (vs *VolumeServer) VolumeEcShardsDelete(ctx context.Context, req *volume_se
hasEcxFile = true
continue
}
+ if fileInfo.Name() == bName+".idx" {
+ hasIdxFile = true
+ continue
+ }
if strings.HasPrefix(fileInfo.Name(), bName+".ec") {
existingShardCount++
}
@@ -200,6 +205,10 @@ func (vs *VolumeServer) VolumeEcShardsDelete(ctx context.Context, req *volume_se
return nil, err
}
}
+ if !hasIdxFile {
+ // .vif is used for ec volumes and normal volumes
+ os.Remove(baseFilename + ".vif")
+ }
return &volume_server_pb.VolumeEcShardsDeleteResponse{}, nil
}