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

sql: DROP TENANT makes name reclaimable #92076

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

stevendanna
Copy link
Collaborator

@stevendanna stevendanna commented Nov 17, 2022

Previously, you couldn't reuse a tenant name until GC completed. This makes the name immediately reclaimable, saving the old name in droppedName in case we need it for something.

Note that with the virtual column this only works because ->> returns NULL for the empty string.

Epic: None

Release note: None

@stevendanna stevendanna requested a review from a team November 17, 2022 17:35
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

Could a test be written to demonstrate reuse?

@stevendanna
Copy link
Collaborator Author

could a test be written to demonstrate reuse

I assume you mean something more than:

https://github.com/cockroachdb/cockroach/pull/92076/files#diff-0178351ae826031e3eeb865eb785179e667e71fc81dc1043a60ae9650796d095R103-R110

perhaps something that actually starts a new sql pod against this tenant and does some work?

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

I somehow missed that. LGTM

Copy link
Contributor

@lidorcarmel lidorcarmel left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @stevendanna)

Previously, you couldn't reuse a tenant name until GC completed. This
makes the name immediately reclaimable, saving the old name in
droppedName in case we need it for something.

Note that with the virtual column this only works because ->> returns
NULL for the empty string.

Release note: None
@stevendanna stevendanna requested a review from a team as a code owner November 17, 2022 21:01
@stevendanna stevendanna requested review from rhu713 and removed request for a team November 17, 2022 21:01
@stevendanna
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Nov 17, 2022

Build succeeded:

@craig craig bot merged commit 98197fd into cockroachdb:master Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants