inode controller: fix the incorrect update of disk status
Before syncing with the node monitor, don't update the storage data
in diskStatus. The incorrect update leads to the wrong StorageMaximum
and StorageAvailable in a short period.
Longhorn 685
@@ -426,8 +426,6 @@ func (nc *NodeController) syncNode(key string) (err error) {
return nil
}
- alignDiskSpecAndStatus(node)
-
mon, err := nc.checkMonitor(nc.controllerID)
if err != nil {
return err
@@ -561,6 +559,8 @@ func (nc *NodeController) enqueueKubernetesNode(obj interface{}) {
}
func (nc *NodeController) syncDiskStatus(node *longhorn.Node, collectedDataInfo map[string]*monitor.CollectedDiskInfo) error {
+ alignDiskSpecAndStatus(node)
+
notReadyDiskInfoMap, readyDiskInfoMap := nc.findNotReadyAndReadyDiskMaps(node, collectedDataInfo)
for _, diskInfoMap := range notReadyDiskInfoMap {
