-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
release-23.2: roachprod: support managing shared process virtual clusters #112709
Merged
renatolabs
merged 6 commits into
release-23.2
from
blathers/backport-release-23.2-111533
Oct 23, 2023
Merged
release-23.2: roachprod: support managing shared process virtual clusters #112709
renatolabs
merged 6 commits into
release-23.2
from
blathers/backport-release-23.2-111533
Oct 23, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously, this function would execute `cockroach sql`, log the output and return whether any errors were found. In this commit, we change the function to return the results to the caller instead. This is more flexible since 1) not every caller might want the results logged; and 2) allows callers to behave differently depending on the output of the statement executed. Epic: none Release note: None
This commit changes when the tenant metadata is created: instead of creating the system table entry out of band in `multitenant.go`, we now make this part of the `Start` function itself; this allows users of roachprod as a library to have this behaviour out of the box. Epic: none Release note: None
This unifies the handling of whether to pass a `cluster=` connection option in `NodeURL`. Previously, this was done out of band before every call to `NodeURL`, which was error prone: as an example, `roachprod sql` had code that correctly handled this (i.e., not setting a cluster option if service mode is shared); `roachprod pgurl`, on the other hand, would always set `cluster=`, generating an invalid connection string. Epic: none Release note: None
This commits changes how `start-sql` operates by introducing a new `--external-cluster` command line argument: when passed, it indicates that the virtual cluster should be serviced by separate SQL server processes. By default `start-sql` will create shared process tenants. The previous behaviour of `start-sql` was to always create separate processes. The "virtual-cluster-nodes" argument that used to be required is now only passed via `--external-cluster`. This commit also changes the `(*SyncedCluster).Start()` code to set default cluster settings for tenants as well, including organization name and license, if available. Epic: none Release note: None
Similar to the previous commit, we now add support to shared process virtual clusters to `stop-sql`. Since there is no process to be stopped in this case, the `stop` call performs a `ALTER TENANT %s STOP SERVICE` call in order to stop the virtual cluster. This should be transparent to the user. Epic: none Release note: None
This changes how virtual clusters are referenced in roachprod commands (`start-sql` and `stop-sql`). Specifically, where before a `cluster-id` was requested, we now request a virtual cluster name. This makes the API more user-friendly and removes the need for the caller to keep track of virtual cluster IDs. With this change we now remove the "default virtual cluster name" logic, which is no longer necessary. Epic: none Release note: None
blathers-crl
bot
force-pushed
the
blathers/backport-release-23.2-111533
branch
from
October 19, 2023 19:44
79ce3cb
to
6b68d73
Compare
blathers-crl
bot
requested review from
herkolategan and
DarrylWong
and removed request for
a team
October 19, 2023 19:44
blathers-crl
bot
added
blathers-backport
This is a backport that Blathers created automatically.
O-robot
Originated from a bot.
labels
Oct 19, 2023
blathers-crl
bot
force-pushed
the
blathers/backport-release-23.2-111533
branch
from
October 19, 2023 19:44
92aa391
to
f02ffd2
Compare
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
blathers-crl
bot
added
the
backport
Label PR's that are backports to older release branches
label
Oct 19, 2023
herkolategan
approved these changes
Oct 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport
Label PR's that are backports to older release branches
blathers-backport
This is a backport that Blathers created automatically.
O-robot
Originated from a bot.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 6/6 commits from #111533 on behalf of @renatolabs.
/cc @cockroachdb/release
This PR adds support for shared process virtual clusters using
start-sql
andstop-sql
; previously, these subcommands would always create separate process virtual clusters. After this PR,start-sql
will create shared process tenants by default. Alternatively, the--external-cluster
command line flag can be used to indicate where the separate processes should be deployed. Similarly,stop-sql
may be used to stop separate process virtual clusters, as before, by killing the corresponding OS process; or shared process virtual clusters by using SQL (STOP SERVICE
).A few other changes introduced in this PR, done to support this work:
ExecSQL
more flexible;pgurl
, where we would include the virtual cluster name in the connection url returned byroachprod pgurl
. This is not allowed since the URL pointed to the SQL server process, which does not handle that option.CREATE TENANT
instead ofcrdb_internal.create_tenant
. The tenant ID is computed automatically and used when starting the cockroach process for separate process deployments.Epic: none
Release note: None
Release justification: test-only change.