diff options
| author | Tobias Gurtzick <wzrdtales@users.noreply.github.com> | 2023-09-25 19:35:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-25 10:35:43 -0700 |
| commit | 78dbac77021f72cc005c45ef68cf0793d4607232 (patch) | |
| tree | d1d60ca830f57159637987fcfc0a171952ca22eb /weed/storage/disk_location_ec.go | |
| parent | faabc695b681ff19cc1bda7af836c1d86052a651 (diff) | |
| download | seaweedfs-78dbac77021f72cc005c45ef68cf0793d4607232.tar.xz seaweedfs-78dbac77021f72cc005c45ef68cf0793d4607232.zip | |
fix(ec): volumes created by foreign collection due to bug in ec balance (#4864)
* fix(ec): ignore 0 byte data files
refers to parts of #4861
Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
* fix(ec): ignore volumes not from the current collection during balance
fixes #4861
Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
---------
Signed-off-by: Tobias Gurtzick <magic@wizardtales.com>
Diffstat (limited to 'weed/storage/disk_location_ec.go')
| -rw-r--r-- | weed/storage/disk_location_ec.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/weed/storage/disk_location_ec.go b/weed/storage/disk_location_ec.go index 8315fe363..6d681d2c2 100644 --- a/weed/storage/disk_location_ec.go +++ b/weed/storage/disk_location_ec.go @@ -2,13 +2,14 @@ package storage import ( "fmt" - "golang.org/x/exp/slices" "os" "path" "regexp" "strconv" "strings" + "golang.org/x/exp/slices" + "github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding" "github.com/seaweedfs/seaweedfs/weed/storage/needle" ) @@ -163,7 +164,15 @@ func (l *DiskLocation) loadAllEcShards() (err error) { continue } - if re.MatchString(ext) { + info, err := fileInfo.Info() + + if err != nil { + continue + } + + // 0 byte files should be only appearing erroneously for ec data files + // so we ignore them + if re.MatchString(ext) && info.Size() > 0 { if prevVolumeId == 0 || volumeId == prevVolumeId { sameVolumeShards = append(sameVolumeShards, fileInfo.Name()) } else { |
