destroy ec volume if it is empty

This commit is contained in:
Chris Lu
2019-06-01 01:51:28 -07:00
parent ba18314aab
commit 133b772fb5
3 changed files with 18 additions and 1 deletions

View File

@@ -94,6 +94,12 @@ func (s *Store) FindEcVolume(vid needle.VolumeId) (*erasure_coding.EcVolume, boo
return nil, false
}
func (s *Store) DestroyEcVolume(vid needle.VolumeId) {
for _, location := range s.Locations {
location.DestroyEcVolume(vid)
}
}
func (s *Store) ReadEcShardNeedle(ctx context.Context, vid needle.VolumeId, n *needle.Needle) (int, error) {
for _, location := range s.Locations {
if localEcVolume, found := location.FindEcVolume(vid); found {