erasure coding: fix EC error if multiple disks are configured in one volume server

This commit is contained in:
Chris Lu
2020-08-26 09:16:58 -07:00
parent d1cf39f180
commit ab759f0ec2
3 changed files with 11 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package storage
import (
"fmt"
"io/ioutil"
"os"
"path"
"regexp"
"sort"
@@ -58,6 +59,9 @@ func (l *DiskLocation) LoadEcShard(collection string, vid needle.VolumeId, shard
ecVolumeShard, err := erasure_coding.NewEcVolumeShard(l.Directory, collection, vid, shardId)
if err != nil {
if err == os.ErrNotExist {
return os.ErrNotExist
}
return fmt.Errorf("failed to create ec shard %d.%d: %v", vid, shardId, err)
}
l.ecVolumesLock.Lock()