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

Check the case that owner object is deleted before finalizer is added #209

Open
nakamasato opened this issue Apr 12, 2023 · 3 comments · May be fixed by #415
Open

Check the case that owner object is deleted before finalizer is added #209

nakamasato opened this issue Apr 12, 2023 · 3 comments · May be fixed by #415
Labels
enhancement New feature or request

Comments

@nakamasato
Copy link
Owner

Example case:

  1. MySQL object is created
  2. MySQLUser/MySQLDB is created for MySQL object (at this point, MySQL object doesn't have finalizer)
  3. MySQL is deleted before finalizer is added
@nakamasato nakamasato added the enhancement New feature or request label Sep 10, 2023
@nakamasato
Copy link
Owner Author

@devloai resolve this issue

Copy link

devloai bot commented Dec 16, 2024

Investigating the race condition between MySQL object deletion and finalizer addition - will implement proper safeguards to prevent orphaned resources.

Status: Done.

devloai bot added a commit that referenced this issue Dec 16, 2024
- Move finalizer handling to beginning of reconciliation loop
- Add early check for deletion without finalizer
- Ensure atomic finalizer addition with requeue
- Separate finalizer addition from other operations

Fixes #209
@devloai devloai bot linked a pull request Dec 16, 2024 that will close this issue
Copy link

devloai bot commented Dec 16, 2024

I've implemented a fix for this issue in PR #415. The solution addresses the race condition by:

  1. Moving finalizer handling to the beginning of the reconciliation loop
  2. Adding an early check for deletion without finalizer
  3. Ensuring atomic finalizer addition with requeue
  4. Separating finalizer addition from other operations

The changes ensure that:

  • Finalizer is added before any dependent resources are created
  • If MySQL is deleted before finalizer is added, it's handled gracefully
  • Finalizer addition is atomic and separate from other operations

A reproduce script has been added to help test this scenario. Please review the PR for the detailed implementation.

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

Successfully merging a pull request may close this issue.

1 participant