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

Race condition where the consumer exists but no username and database #36

Open
vincenzodnp opened this issue Jan 26, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@vincenzodnp
Copy link

Today we had an edge case because the manager container of the dbaas operator pod was in OOM.
For a project, we had the mariadbconsumer object created and the spec.consumer info correctly filled in, but actually, no username, password, and database were created in the cluster.

Checking the code, it seems the creation of the username (password) and database happens AFTER the consumer's Infos are defined into the k8s object.

@shreddedbacon shreddedbacon added the bug Something isn't working label Jan 26, 2021
@shreddedbacon shreddedbacon self-assigned this Jan 26, 2021
@shreddedbacon
Copy link
Member

The database / user creation happens here https://github.com/amazeeio/dbaas-operator/blob/main/controllers/mariadb/mariadbconsumer_controller.go#L171

And the update of the k8s resource happens here https://github.com/amazeeio/dbaas-operator/blob/main/controllers/mariadb/mariadbconsumer_controller.go#L238

So the username and database are created prior to the k8s resource being updated.

If the MariaDBConsumer resource had the username, password, and database, along with all the associated services created, but there was no matching database or user in the actual destination MariaDBProvider, then that would be interesting to see.

You don't happen to have the logs from the operator when this was occuring? It would have been vomiting up errors the entire time it tried to do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants