Skip to content
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

Corner Case: Clenup Processing for Delete Event Without Finalizer #1597

Open
csviri opened this issue Nov 14, 2022 · 3 comments
Open

Corner Case: Clenup Processing for Delete Event Without Finalizer #1597

csviri opened this issue Nov 14, 2022 · 3 comments
Labels

Comments

@csviri
Copy link
Collaborator

csviri commented Nov 14, 2022

If Cleaner interface is implemented by a reconciler a finalizer is automatically added to the custom resource, and cleaner is called before it gets removed.
There is however a corner case when it makes sense to do cleanup event finalizer is not used. In case there is an in memory data held for a custom resource, so when a custom resource deleted, related indexed or in memory objects needs to be cleaned up. In this case a finalizer is not needed, since if the operator is down and the delete event is missed it's not a problem, since the cleanup is just for in memory data.

To support this we could add a feature flag to @ControllerConfiguration to don't add finalizer for cleanup: addFinalizerForCleaner.

Note that this is not a priority issue, we should probably implement it only if some requests it. Also having a finalizer in those cases would not be a big issues.

@csviri csviri added the feature label Nov 14, 2022
@10000-ki
Copy link
Contributor

@csviri hi~
I'm having a similar issue.
Sometimes, if Operator is removed before CR is completely deleted
Because of the finalizer set in CR, CR deletion is impossible
There is an inconvenience of having to forcibly remove the finalizer

is there any improvement about this feature?

@csviri
Copy link
Collaborator Author

csviri commented Feb 14, 2024

Hi @10000-ki , I assume you are rather are talking about this problem:
#1876

which will be solved eventually, this issue is about not having finalizers but still executing the cleanup code BUT JUST for the goal to cleanup some in-memory state. (Note that in case of operator restart that is cleaned up without finalizer by the OS). So this is not replacing the current behavior, just covering a corner use-case.

@10000-ki
Copy link
Contributor

Thank you for the explanation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants