From 70efadc2f44835955ed38d03b5c46eaa246ac368 Mon Sep 17 00:00:00 2001 From: Jing Xu Date: Fri, 7 Oct 2016 16:17:22 -0700 Subject: [PATCH] Node status updater should SetNodeStatusUpdateNeeded if it fails to update status When volume controller tries to update the node status, if it fails to update the nodes status, it should call SetNodeStatusUpdateNeeded so that the volume list could be updated next time. --- .../statusupdater/node_status_updater.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go b/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go index 5cad0af1d43..6e11fc3de1f 100644 --- a/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go +++ b/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go @@ -62,11 +62,14 @@ func (nsu *nodeStatusUpdater) UpdateNodeStatuses() error { for nodeName, attachedVolumes := range nodesToUpdate { nodeObj, exists, err := nsu.nodeInformer.GetStore().GetByKey(string(nodeName)) if nodeObj == nil || !exists || err != nil { - // If node does not exist, its status cannot be updated, log error and move on. - glog.V(5).Infof( + // If node does not exist, its status cannot be updated, log error and + // reset flag statusUpdateNeeded back to true to indicate this node status + // needs to be udpated again + glog.V(2).Infof( "Could not update node status. Failed to find node %q in NodeInformer cache. %v", nodeName, err) + nsu.actualStateOfWorld.SetNodeStatusUpdateNeeded(nodeName) continue } @@ -115,11 +118,12 @@ func (nsu *nodeStatusUpdater) UpdateNodeStatuses() error { nodeName, err) } - - glog.V(3).Infof( - "Updating status for node %q succeeded. patchBytes: %q", + glog.V(2).Infof( + "Updating status for node %q succeeded. patchBytes: %q VolumesAttached: %v", nodeName, - string(patchBytes)) + string(patchBytes), + node.Status.VolumesAttached) + } return nil }