diff options
| author | Chris Lu <chris.lu@gmail.com> | 2017-06-16 08:27:50 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2017-06-16 08:27:50 -0700 |
| commit | 2c7dad589dcb7ed513180eb4a743e389f8134a73 (patch) | |
| tree | 2d07508846734ba7114f138f940ab6aa5f30a139 | |
| parent | 72e89b615b02f1af03d0f838ea6feb394ab1d401 (diff) | |
| download | seaweedfs-2c7dad589dcb7ed513180eb4a743e389f8134a73.tar.xz seaweedfs-2c7dad589dcb7ed513180eb4a743e389f8134a73.zip | |
stop when dn.parent is nil
fix https://github.com/chrislusf/seaweedfs/issues/473
| -rw-r--r-- | weed/topology/topology_event_handling.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/topology/topology_event_handling.go b/weed/topology/topology_event_handling.go index e2dcfca06..44ab33114 100644 --- a/weed/topology/topology_event_handling.go +++ b/weed/topology/topology_event_handling.go @@ -56,5 +56,7 @@ func (t *Topology) UnRegisterDataNode(dn *DataNode) { dn.UpAdjustVolumeCountDelta(-dn.GetVolumeCount()) dn.UpAdjustActiveVolumeCountDelta(-dn.GetActiveVolumeCount()) dn.UpAdjustMaxVolumeCountDelta(-dn.GetMaxVolumeCount()) - dn.Parent().UnlinkChildNode(dn.Id()) + if dn.Parent() != nil { + dn.Parent().UnlinkChildNode(dn.Id()) + } } |
