mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
remove .vif files
This commit is contained in:
parent
a057cd6c61
commit
df636e4c14
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue