-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vrg: use reader instead of client for check hooks #1750
vrg: use reader instead of client for check hooks #1750
Conversation
Co-Authored-by: Annaraya Narasagond <[email protected]> Signed-off-by: Raghavendra Talur <[email protected]>
@raghavendra-talur It looks good to me, but I have a question about the cache. Are we potentially undermining the purpose of skipping the usage of the cache? If it's used selectively, that would be fine, but consistently hitting etcd instead of the cache feels like an expensive operation. Also, what’s the downside of not finding the "just created resource" in the cache? The next reconciliation cycle should pick it up and things should be fine. Why is it so important that we find it right after we create it. One reason for it would be to not try to recreate it again -- ok, that would be a valid reason. But is that the case? |
There were two different issues we saw:
Using the reader solves both the problems. There are pros and cons to using the reader instead of using the cached client. One downside is that we hit the api-server for every backup or restore job, like you said. The pro is that we don't have to maintain the cache for pods, deployment and stateful set. Comparing the two, I really think the pro of not having to keep the cache about pods,deployment,statefulset in the ramen process memory wins. These resources are not something that ramen relies on in most of the cases(managed apps and discovered with no hooks). It is only in the case of discovered apps with hooks in the recipe that we need this information. I need to write a unit test that proves this but haven't been able to complete that in this PR. Will do it in a follow up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
Thanks @raghavendra-talur. Based on what you’ve said, it’s strange that the client-go cache behaves that way, but I’ll leave it at that. |
When using the cached client, we fail to find the resource if it is recently created.