controller: ReplicaController does not enqueue irrelavent replicas for backing image changes
Longhorn 3242
@@ -762,16 +762,18 @@ func (rc *ReplicaController) enqueueBackingImageChange(obj interface{}) {
}
}
- for diskUUID := range backingImage.Status.DiskFileStatusMap {
- replicas, err := rc.ds.ListReplicasByDiskUUID(diskUUID)
+ replicas, err := rc.ds.ListReplicasByNodeRO(rc.controllerID)
if err != nil {
- utilruntime.HandleError(fmt.Errorf("failed to list replicas in disk %v for backing image %v: %v", diskUUID, backingImage.Name, err))
- continue
+ utilruntime.HandleError(fmt.Errorf("failed to list replicas on node %v for backing image %v: %v", rc.controllerID, backingImage.Name, err))
+ return
}
+ for diskUUID := range backingImage.Status.DiskFileStatusMap {
for _, r := range replicas {
+ if r.Spec.DiskID == diskUUID && r.Spec.BackingImage == backingImage.Name {
rc.enqueueReplica(r)
}
}
+ }
}
