mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-22 02:57:23 +08:00
avoid possible nil
fix https://github.com/chrislusf/seaweedfs/issues/1928 The nil was because of `dn.Parent().UnlinkChildNode(dn.Id())` in topo.UnRegisterDataNode() function, when the dn leaves the cluster.
This commit is contained in:
@@ -80,10 +80,14 @@ func (ms *MasterServer) SendHeartbeat(stream master_pb.Seaweed_SendHeartbeatServ
|
||||
dn.AdjustMaxVolumeCounts(heartbeat.MaxVolumeCounts)
|
||||
|
||||
glog.V(4).Infof("master received heartbeat %s", heartbeat.String())
|
||||
var dataCenter string
|
||||
if dc := dn.GetDataCenter(); dc != nil {
|
||||
dataCenter = string(dc.Id())
|
||||
}
|
||||
message := &master_pb.VolumeLocation{
|
||||
Url: dn.Url(),
|
||||
PublicUrl: dn.PublicUrl,
|
||||
DataCenter: string(dn.GetDataCenter().Id()),
|
||||
DataCenter: dataCenter,
|
||||
}
|
||||
if len(heartbeat.NewVolumes) > 0 || len(heartbeat.DeletedVolumes) > 0 {
|
||||
// process delta volume ids if exists for fast volume id updates
|
||||
|
Reference in New Issue
Block a user