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

playbooks controller error when saving #980

Closed
adityathebe opened this issue Apr 27, 2024 · 1 comment · Fixed by #985
Closed

playbooks controller error when saving #980

adityathebe opened this issue Apr 27, 2024 · 1 comment · Fixed by #985
Assignees
Labels
bug Something isn't working

Comments

@adityathebe
Copy link
Member

adityathebe commented Apr 27, 2024

mission-control/db/playbooks.go:202 ERROR: duplicate key value violates unique constraint "playbook_name_key" (SQLSTATE 23505)

This happens if a playbook CRD is deleted and reapplied. The old playbook still has a record in db and when the CRD is applied again it gets a new id but then runs into the unique name constraint violation.

This is the case with Connections controller as well.

Should be handled like how we're handling it in the topology controller.

@adityathebe
Copy link
Member Author

@moshloop The way canary-checker is handling this, which I initially thought would be the correct approach, is also incorrect. If a topology (name: cluster) is deleted and then later someone applies another topology with the same name, we just update the original cluster topology spec and then undelete it. Which is wrong as the newly applied topology will have all sort of relationships to other tables (jobhistory, checks, ...).

I think changing the unique constraint to active records might be the solution we're looking for.

wdyt?

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

Successfully merging a pull request may close this issue.

1 participant