10000 feat(coderd/database): add UpsertProvisionerDaemons query by johnstcn · Pull Request #11178 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat(coderd/database): add UpsertProvisionerDaemons query #11178

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

Merged
merged 4 commits into from
Dec 13, 2023

Conversation

johnstcn
Copy link
Member
@johnstcn johnstcn commented Dec 13, 2023

Part of #10676

ALTER TABLE ONLY provisioner_daemons
DROP CONSTRAINT IF EXISTS provisioner_daemons_name_key;

CREATE UNIQUE INDEX IF NOT EXISTS idx_provisioner_daemons_name_owner_key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, do we need an index since Day 1? What was the upper limit of provisioner daemons we hit in scaletests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to at least keep the existing unique index on name.
However, this will allow multiple user-level provisioners to be named "my-provisioner".
Otherwise, each user will have to choose a unique provisioner name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, I ignored the use case with multiple users 👍 Thanks

@johnstcn johnstcn marked this pull request as ready for review December 13, 2023 12:16
Copy link
Member
@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MutateTags seems to be a bit tangled, but as you have covered it with tests, I'm 👍

@johnstcn johnstcn merged commit 4f7ae64 into main Dec 13, 2023
@johnstcn johnstcn deleted the cj/UpsertProvisionerDaemon branch December 13, 2023 12:31
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0