1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-06-01 08:12:02 +02:00
This commit is contained in:
Taehyung Lim 2024-04-26 23:09:02 +09:00 committed by GitHub
commit 943d143bd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -638,7 +638,10 @@ func (c *commandVolumeFsck) collectVolumeIds() (volumeIdToServer map[string]map[
eachDataNode(topologyInfo, func(dc string, rack RackId, t *master_pb.DataNodeInfo) {
for _, diskInfo := range t.DiskInfos {
dataNodeId := t.GetId()
volumeIdToServer[dataNodeId] = make(map[uint32]VInfo)
if _, ok := volumeIdToServer[dataNodeId]; !ok {
volumeIdToServer[dataNodeId] = make(map[uint32]VInfo)
}
volumeCount := 0
for _, vi := range diskInfo.VolumeInfos {
volumeIdToServer[dataNodeId][vi.Id] = VInfo{
server: pb.NewServerAddressFromDataNode(t),
@ -646,6 +649,7 @@ func (c *commandVolumeFsck) collectVolumeIds() (volumeIdToServer map[string]map[
isEcVolume: false,
isReadOnly: vi.ReadOnly,
}
volumeCount += 1
}
for _, ecShardInfo := range diskInfo.EcShardInfos {
volumeIdToServer[dataNodeId][ecShardInfo.Id] = VInfo{
@ -654,9 +658,10 @@ func (c *commandVolumeFsck) collectVolumeIds() (volumeIdToServer map[string]map[
isEcVolume: true,
isReadOnly: true,
}
volumeCount += 1
}
if *c.verbose {
fmt.Fprintf(c.writer, "dn %+v collected %d volumes and locations.\n", dataNodeId, len(volumeIdToServer[dataNodeId]))
fmt.Fprintf(c.writer, "dn %+v collected %d volumes and locations.\n", dataNodeId, volumeCount)
}
}
})