seaweedfs/weed/pb
Chris Lu 41b6ad002b
fix(volume.list): show one entry per physical disk on multi-disk nodes (#9541)
* fix(volume.list): show one entry per physical disk on multi-disk nodes

DataNodeInfo.DiskInfos is keyed by disk type, so several same-type
physical disks on one node collapse to a single map entry at the master.
volume.list iterated that map directly and reported one "Disk hdd ...
id:0" line per node, hiding the per-disk volume and shard layout. EC
operators on multi-disk volume servers had no way to verify which
physical disk a shard landed on.

Lift the per-physical-disk split into a DiskInfo.SplitByPhysicalDisk()
method on the proto type so consumers outside admin/topology can use
it. Apply it in writeDataNodeInfo so the verbose Disk block shows one
entry per physical disk, ordered by DiskId. Capacity counters are
split evenly across reconstructed disks since the wire format doesn't
carry per-disk capacity yet.

This is a display-only change. ActiveTopology already did the split on
its own and is now updated to call the shared helper.

* fix(volume.list): preserve totals, count active/remote exactly, dedupe header

Address review feedback on the per-physical-disk split:

- share() truncated remainders so reconstructed per-disk counters could
  sum to less than the original aggregate (10 / 3 = 3+3+3). Distribute
  the remainder to the lowest disk ids so MaxVolumeCount and
  FreeVolumeCount sum exactly back to the node totals.
- ActiveVolumeCount and RemoteVolumeCount are derivable per disk from
  the VolumeInfos already grouped by DiskId, so count them exactly
  (ReadOnly=false and RemoteStorageName!="" respectively) instead of
  approximating with an even split.
- writeDataNodeInfo's per-disk callback fired the DataNode header on
  every iteration after the split, so a node with 6 physical disks
  emitted 6 DataNode headers. Guard the callback with headerPrinted so
  the header still appears at most once per node.
- Sort split disks deterministically using explicit DiskId comparison
  to avoid int overflow risk on 32-bit systems.
- Tighten the volume.list test substring to "id:N\n" so unrelated
  tokens like "ec volume id:101" don't accidentally match the id:1
  needle, and assert the rack callback fires once.
2026-05-18 14:43:44 -07:00
..
filer_pb peer chunk sharing 1/8: proto definitions (#9130) 2026-04-18 20:02:55 -07:00
iam_pb fix(s3): include static identities in listing operations (#8903) 2026-04-03 20:01:28 -07:00
master_pb fix(volume.list): show one entry per physical disk on multi-disk nodes (#9541) 2026-05-18 14:43:44 -07:00
message_fbs add message batch 2022-07-28 23:24:38 -07:00
mount_pb IAM Policy Management via gRPC (#8109) 2026-01-25 13:39:30 -08:00
mount_peer_pb peer chunk sharing 1/8: proto definitions (#9130) 2026-04-18 20:02:55 -07:00
mq_agent_pb IAM Policy Management via gRPC (#8109) 2026-01-25 13:39:30 -08:00
mq_pb IAM Policy Management via gRPC (#8109) 2026-01-25 13:39:30 -08:00
plugin_pb refactor(plugin): rename detection_interval_seconds → detection_interval_minutes (#9366) 2026-05-08 10:33:02 -07:00
remote_pb feat(filer): add lazy directory listing for remote mounts (#8615) 2026-03-13 09:36:54 -07:00
s3_lifecycle_pb feat(s3/lifecycle): LifecycleDelete RPC server (#9349) 2026-05-07 15:03:33 -07:00
s3_pb iam: add IAM group management (#8560) 2026-03-09 11:54:32 -07:00
schema_pb IAM Policy Management via gRPC (#8109) 2026-01-25 13:39:30 -08:00
volume_server_pb fix(ec): preserve source disk type across EC encoding (#9423) (#9449) 2026-05-11 20:21:50 -07:00
worker_pb fix(ec): preserve source disk type across EC encoding (#9423) (#9449) 2026-05-11 20:21:50 -07:00
filer_pb_direct_read_test.go filer.sync: send log file chunk fids to clients for direct volume server reads (#8792) 2026-03-27 11:01:29 -07:00
filer_pb_direct_read.go Adjust rename events metadata format (#8854) 2026-03-30 18:25:11 -07:00
filer_pb_tail.go go fmt 2026-04-10 17:31:14 -07:00
filer.proto peer chunk sharing 1/8: proto definitions (#9130) 2026-04-18 20:02:55 -07:00
grpc_client_server_test.go fix(pb): skip Unix-socket gRPC registration on Windows (#9430) (#9434) 2026-05-11 10:25:37 -07:00
grpc_client_server.go fix(pb): skip Unix-socket gRPC registration on Windows (#9430) (#9434) 2026-05-11 10:25:37 -07:00
iam.proto fix(s3): include static identities in listing operations (#8903) 2026-04-03 20:01:28 -07:00
Makefile feat(s3/lifecycle): LifecycleDelete RPC server (#9349) 2026-05-07 15:03:33 -07:00
master.proto admin: report file and delete counts for EC volumes (#9060) 2026-04-13 21:10:36 -07:00
message.fbs add message batch 2022-07-28 23:24:38 -07:00
mount_peer.proto peer chunk sharing 1/8: proto definitions (#9130) 2026-04-18 20:02:55 -07:00
mount.proto move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
mq_agent.proto Add Kafka Gateway (#7231) 2025-10-13 18:05:17 -07:00
mq_broker.proto Fixes for kafka gateway (#7329) 2025-10-17 20:49:47 -07:00
mq_schema.proto Add Kafka Gateway (#7231) 2025-10-13 18:05:17 -07:00
plugin.proto refactor(plugin): rename detection_interval_seconds → detection_interval_minutes (#9366) 2026-05-08 10:33:02 -07:00
proto_read_write_test.go fix tests 2022-08-18 00:15:46 -07:00
remote.proto feat(filer): add lazy directory listing for remote mounts (#8615) 2026-03-13 09:36:54 -07:00
s3_lifecycle.proto feat(s3/lifecycle): LifecycleDelete RPC server (#9349) 2026-05-07 15:03:33 -07:00
s3.proto iam: add IAM group management (#8560) 2026-03-09 11:54:32 -07:00
server_address_test.go fix: port in SNI address when using domainName instead of IP for master (#8500) 2026-03-04 07:05:45 -08:00
server_address.go chore: remove ~50k lines of unreachable dead code (#8913) 2026-04-03 16:04:27 -07:00
server_discovery.go chore: execute goimports to format the code (#7983) 2026-01-07 13:06:08 -08:00
shared_values.go remove fixJpgOrientation 2020-06-20 12:50:40 -07:00
volume_server.proto fix(ec): preserve source disk type across EC encoding (#9423) (#9449) 2026-05-11 20:21:50 -07:00
worker.proto fix(ec): preserve source disk type across EC encoding (#9423) (#9449) 2026-05-11 20:21:50 -07:00