SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
volume server UI: fix ec volume ui (#7104)
Chris Lub4d9618efc47
diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.goindex 5981c5efe4..88e94115dc 100644--- a/weed/server/volume_grpc_erasure_coding.go+++ b/weed/server/volume_grpc_erasure_coding.go@@ -492,7 +492,7 @@ func (vs *VolumeServer) VolumeEcShardsInfo(ctx context.Context, req *volume_servfor _, shardDetail := range shardDetails {ecShardInfo := &volume_server_pb.EcShardInfo{ShardId: uint32(shardDetail.ShardId),- Size: shardDetail.Size,+ Size: int64(shardDetail.Size),Collection: v.Collection,}ecShardInfos = append(ecShardInfos, ecShardInfo)diff --git a/weed/server/volume_server_handlers_ui.go b/weed/server/volume_server_handlers_ui.goindex b1ff0317ff..5679eb4834 100644--- a/weed/server/volume_server_handlers_ui.go+++ b/weed/server/volume_server_handlers_ui.go@@ -1,12 +1,14 @@package weed_serverimport (- "github.com/seaweedfs/seaweedfs/weed/pb"- "github.com/seaweedfs/seaweedfs/weed/util/version""net/http""path/filepath""time"+ "github.com/seaweedfs/seaweedfs/weed/glog"+ "github.com/seaweedfs/seaweedfs/weed/pb"+ "github.com/seaweedfs/seaweedfs/weed/util/version"+"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"ui "github.com/seaweedfs/seaweedfs/weed/server/volume_server_ui""github.com/seaweedfs/seaweedfs/weed/stats"@@ -53,5 +55,8 @@ func (vs *VolumeServer) uiStatusHandler(w http.ResponseWriter, r *http.Request)infos,serverStats,}- ui.StatusTpl.Execute(w, args)+ if err := ui.StatusTpl.Execute(w, args); err != nil {+ glog.Errorf("template execution error: %v", err)+ http.Error(w, "Internal server error", http.StatusInternalServerError)+ }}diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.goindex 61057674f9..839428e7b2 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}