aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/erasure_coding
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2025-08-07 00:07:03 -0700
committerGitHub <noreply@github.com>2025-08-07 00:07:03 -0700
commitb4d9618efc476443799f3700b5edf34fefee534a (patch)
tree2464bfe6800ad24657ec4f8e280d886803df6366 /weed/storage/erasure_coding
parentdd4880d55a193709a2eb05b39d7326ef7834457a (diff)
downloadseaweedfs-b4d9618efc476443799f3700b5edf34fefee534a.tar.xz
seaweedfs-b4d9618efc476443799f3700b5edf34fefee534a.zip
volume server UI: fix ec volume ui (#7104)
* fix ec volume ui * Update weed/storage/erasure_coding/ec_volume.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Diffstat (limited to 'weed/storage/erasure_coding')
-rw-r--r--weed/storage/erasure_coding/ec_volume.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.go
index 61057674f..839428e7b 100644
--- a/weed/storage/erasure_coding/ec_volume.go
+++ b/weed/storage/erasure_coding/ec_volume.go
@@ -178,9 +178,11 @@ func (ev *EcVolume) ShardSize() uint64 {
return 0
}
-func (ev *EcVolume) Size() (size int64) {
+func (ev *EcVolume) Size() (size uint64) {
for _, shard := range ev.Shards {
- size += shard.Size()
+ if shardSize := shard.Size(); shardSize > 0 {
+ size += uint64(shardSize)
+ }
}
return
}
@@ -198,15 +200,18 @@ func (ev *EcVolume) ShardIdList() (shardIds []ShardId) {
type ShardInfo struct {
ShardId ShardId
- Size int64
+ Size uint64
}
func (ev *EcVolume) ShardDetails() (shards []ShardInfo) {
for _, s := range ev.Shards {
- shards = append(shards, ShardInfo{
- ShardId: s.ShardId,
- Size: s.Size(),
- })
+ shardSize := s.Size()
+ if shardSize >= 0 {
+ shards = append(shards, ShardInfo{
+ ShardId: s.ShardId,
+ Size: uint64(shardSize),
+ })
+ }
}
return
}