collect ec shard from multiple locations

fix https://github.com/seaweedfs/seaweedfs/issues/4365
This commit is contained in:
chrislu
2023-04-17 22:56:21 -07:00
parent d50d736e68
commit 0a22eea55d
4 changed files with 47 additions and 6 deletions

View File

@@ -116,6 +116,17 @@ func (s *Store) FindEcVolume(vid needle.VolumeId) (*erasure_coding.EcVolume, boo
return nil, false
}
// shardFiles is a list of shard files, which is used to return the shard locations
func (s *Store) CollectEcShards(vid needle.VolumeId, shardFileNames []string) (ecVolume *erasure_coding.EcVolume, found bool) {
for _, location := range s.Locations {
if s, found := location.CollectEcShards(vid, shardFileNames); found {
ecVolume = s
found = true
}
}
return
}
func (s *Store) DestroyEcVolume(vid needle.VolumeId) {
for _, location := range s.Locations {
location.DestroyEcVolume(vid)