collect ec volume total volume size

This commit is contained in:
chrislu
2025-08-12 22:47:10 -07:00
parent 1485330547
commit c0e6d00bd3
4 changed files with 17 additions and 5 deletions

View File

@@ -956,7 +956,7 @@ func (s *AdminServer) getVolumeHealthFromServer(server string, volumeID uint32)
} else if deletionResp != nil {
// Create health info with deletion data
healthInfo = &EcVolumeHealthInfo{
TotalSize: totalSize, // May be 0 for EC-only volumes
TotalSize: deletionResp.TotalSize, // Get total size from EC deletion info
DeletedByteCount: deletionResp.DeletedBytes,
FileCount: fileCount,
DeleteCount: deletionResp.DeletedCount,

View File

@@ -490,6 +490,7 @@ message VolumeEcDeletionInfoResponse {
uint64 deleted_bytes = 1;
uint64 deleted_count = 2;
repeated uint64 deleted_needle_ids = 3; // list of deleted needle IDs for debugging
uint64 total_size = 4; // total size of the EC volume in bytes
}
message ReadVolumeFileStatusRequest {

View File

@@ -4125,6 +4125,7 @@ type VolumeEcDeletionInfoResponse struct {
DeletedBytes uint64 `protobuf:"varint,1,opt,name=deleted_bytes,json=deletedBytes,proto3" json:"deleted_bytes,omitempty"`
DeletedCount uint64 `protobuf:"varint,2,opt,name=deleted_count,json=deletedCount,proto3" json:"deleted_count,omitempty"`
DeletedNeedleIds []uint64 `protobuf:"varint,3,rep,packed,name=deleted_needle_ids,json=deletedNeedleIds,proto3" json:"deleted_needle_ids,omitempty"` // list of deleted needle IDs for debugging
TotalSize uint64 `protobuf:"varint,4,opt,name=total_size,json=totalSize,proto3" json:"total_size,omitempty"` // total size of the EC volume in bytes
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -4180,6 +4181,13 @@ func (x *VolumeEcDeletionInfoResponse) GetDeletedNeedleIds() []uint64 {
return nil
}
func (x *VolumeEcDeletionInfoResponse) GetTotalSize() uint64 {
if x != nil {
return x.TotalSize
}
return 0
}
type ReadVolumeFileStatusRequest struct {
state protoimpl.MessageState `protogen:"open.v1"`
VolumeId uint32 `protobuf:"varint,1,opt,name=volume_id,json=volumeId,proto3" json:"volume_id,omitempty"`
@@ -6602,11 +6610,13 @@ const file_volume_server_proto_rawDesc = "" +
"collection\x12\x1e\n" +
"\n" +
"generation\x18\x03 \x01(\rR\n" +
"generation\"\x96\x01\n" +
"generation\"\xb5\x01\n" +
"\x1cVolumeEcDeletionInfoResponse\x12#\n" +
"\rdeleted_bytes\x18\x01 \x01(\x04R\fdeletedBytes\x12#\n" +
"\rdeleted_count\x18\x02 \x01(\x04R\fdeletedCount\x12,\n" +
"\x12deleted_needle_ids\x18\x03 \x03(\x04R\x10deletedNeedleIds\":\n" +
"\x12deleted_needle_ids\x18\x03 \x03(\x04R\x10deletedNeedleIds\x12\x1d\n" +
"\n" +
"total_size\x18\x04 \x01(\x04R\ttotalSize\":\n" +
"\x1bReadVolumeFileStatusRequest\x12\x1b\n" +
"\tvolume_id\x18\x01 \x01(\rR\bvolumeId\"\xe3\x03\n" +
"\x1cReadVolumeFileStatusResponse\x12\x1b\n" +

View File

@@ -561,9 +561,10 @@ func (vs *VolumeServer) VolumeEcDeletionInfo(ctx context.Context, req *volume_se
resp.DeletedBytes = deletedBytes
resp.DeletedCount = deletedCount
resp.DeletedNeedleIds = deletedNeedleIds
resp.TotalSize = totalVolumeSize
glog.V(1).Infof("EC volume %d deletion info: %d deleted needles, %d deleted bytes",
req.VolumeId, deletedCount, deletedBytes)
glog.V(1).Infof("EC volume %d deletion info: %d deleted needles, %d deleted bytes, %d total bytes",
req.VolumeId, deletedCount, deletedBytes, totalVolumeSize)
return resp, nil
}