aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/erasure_coding
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-10-27 23:04:55 -0700
committerchrislu <chris.lu@gmail.com>2025-10-27 23:04:55 -0700
commitb7ba6785a2252f7a9c0e5192431b97e384034771 (patch)
treeb63b42437212683ba6583736030c8cf915421a86 /weed/storage/erasure_coding
parent208d7f24f46fead096fd92432b90ebee7c406216 (diff)
downloadseaweedfs-b7ba6785a2252f7a9c0e5192431b97e384034771.tar.xz
seaweedfs-b7ba6785a2252f7a9c0e5192431b97e384034771.zip
go fmt
Diffstat (limited to 'weed/storage/erasure_coding')
-rw-r--r--weed/storage/erasure_coding/ec_volume.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.go
index 3e323163e..5cff1bc4b 100644
--- a/weed/storage/erasure_coding/ec_volume.go
+++ b/weed/storage/erasure_coding/ec_volume.go
@@ -74,12 +74,12 @@ func NewEcVolume(diskType types.DiskType, dir string, dirIdx string, collection
ev.Version = needle.Version(volumeInfo.Version)
ev.datFileSize = volumeInfo.DatFileSize
ev.ExpireAtSec = volumeInfo.ExpireAtSec
-
+
// Initialize EC context from .vif if present; fallback to defaults
if volumeInfo.EcShardConfig != nil {
ds := int(volumeInfo.EcShardConfig.DataShards)
ps := int(volumeInfo.EcShardConfig.ParityShards)
-
+
// Validate shard counts to prevent zero or invalid values
if ds <= 0 || ps <= 0 || ds+ps > MaxShardCount {
glog.Warningf("Invalid EC config in VolumeInfo for volume %d (data=%d, parity=%d), using defaults", vid, ds, ps)