Description of problem (please be detailed as possible and provide log snippests): Backingstore Reconcilliation happening over 2000 times an hour Please review the code with me. The pjg(backingstore.go) and the controller(backingstore_controller.go) below that calls it. // MapSecretToBackingStores returns a list of backingstores that uses the secret in their secretRefernce // used by backingstore_contorller to watch secrets changes func MapSecretToBackingStores(secret types.NamespacedName) []reconcile.Request { log := util.Logger() log.Infof("checking which backingstore to reconcile. mapping secret %v to backingstores", secret) bsList := &nbv1.BackingStoreList{ TypeMeta: metav1.TypeMeta{Kind: "BackingStoreList"}, } if !util.KubeList(bsList, &client.ListOptions{Namespace: secret.Namespace}) { log.Infof("Cloud not found backingStores in namespace %q, while trying to find Backingstore that uses %s secrte", secret.Namespace, secret.Name) return nil } reqs := []reconcile.Request{} for _, bs := range bsList.Items { bsSecret, err := util.GetBackingStoreSecret(&bs) if err != nil { log.Errorf(err.Error()) } if bsSecret != nil && bsSecret.Name == secret.Name { reqs = append(reqs, reconcile.Request{ NamespacedName: types.NamespacedName{ Name: bs.Name, Namespace: bs.Namespace, }, }) } } log.Infof("will reconcile these backingstores: %v", reqs) return reqs } and then from its controller thats calling above // setting another handler to watch events on secrets that not necessarily owned by the Backingstore. // only one OwnerReference can be a controller see: // https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/controller/controllerutil/controllerutil.go#L54 secretsHandler := handler.EnqueueRequestsFromMapFunc(func(ctx context.Context, obj client.Object) []reconcile.Request { return backingstore.MapSecretToBackingStores(types.NamespacedName{ Name: obj.GetName(), Namespace: obj.GetNamespace(), }) }) err = c.Watch(source.Kind(mgr.GetCache(), &corev1.Secret{}), secretsHandler, logEventsPredicate) if err != nil { return err } should there be a limit on how many times it checks every hour? Version of all relevant components (if applicable): ODF 4.13 Does this issue impact your ability to continue to work with the product (please explain in detail what is the user impact)? it does not stop operations, it slows down operations Is there any workaround available to the best of your knowledge? the code is working, but this is an enquiry whether or not it should be limited Rate from 1 - 5 the complexity of the scenario you performed that caused this bug (1 - very simple, 5 - very complex)? Can this issue reproducible? n/a customer environment only Can this issue reproduce from the UI? n/a customer environment only If this is a regression, please provide more details to justify this: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: Red Hat OpenShift Data Foundation 4.15.0 security, enhancement, & bug fix update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2024:1383