Skip to content

roachtest: add SQL instance to connection options#111582

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
herkolategan:hbl/roachtest-mt-conn
Oct 9, 2023
Merged

roachtest: add SQL instance to connection options#111582
craig[bot] merged 1 commit intocockroachdb:masterfrom
herkolategan:hbl/roachtest-mt-conn

Conversation

@herkolategan
Copy link
Copy Markdown
Collaborator

Previously ConnOption did not support passing a SQL Instance. This change adds SQL Instance to ConnOption and updates the relevant calls to pass the information in order to support specifying a specific SQL instance if required.

A SQL Instance can be viewed as a unique identifier for the SQL Instance that is running on a VM in the event that there are more than one SQL Instance serving the same virtual cluster on that VM.

In the future virtual cluster name and SQL instance could be grouped possibly in struct for convenience.

Epic: None
Release Note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@herkolategan herkolategan marked this pull request as ready for review October 3, 2023 13:14
@herkolategan herkolategan requested a review from a team as a code owner October 3, 2023 13:14
@herkolategan herkolategan requested review from smg260 and srosenberg and removed request for a team October 3, 2023 13:14
Copy link
Copy Markdown
Member

@srosenberg srosenberg left a comment

Choose a reason for hiding this comment

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

At the moment all callers are passing 0. Is there an imminent use-case where it would be non-zero?

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @herkolategan and @smg260)


pkg/cmd/roachtest/tests/drain.go line 246 at r1 (raw file):

	prepareCluster(ctx, t, c, drainWaitDuration, connectionWaitDuration, queryWaitDuration)

	pgURL, err := c.ExternalPGUrl(ctx, t.L(), c.Node(nodeToDrain), "" /* tenant */, 0)

Nit: /* sqlInstance */ 0 [1]

[1] https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/1881669848/Go+function+argument+patterns#Naive-style%3A-%E2%80%9Crequire-everything%E2%80%9D

Copy link
Copy Markdown

@renatolabs renatolabs left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @herkolategan and @smg260)

Previously `ConnOption` did not support passing a SQL Instance. This change adds
SQL Instance to `ConnOption` and updates the relevant calls to pass the
information in order to support specifying a specific SQL instance if required.

A SQL Instance can be viewed as a unique identifier for the SQL Instance that is
running on a VM in the event that there are more than one SQL Instance serving
the same virtual cluster on that VM.

In the future virtual cluster name and SQL instance could be grouped possibly in
struct for convenience.

Epic: None
Release Note: None
@herkolategan herkolategan force-pushed the hbl/roachtest-mt-conn branch from a4c7d47 to 7de3b43 Compare October 9, 2023 16:37
Copy link
Copy Markdown
Collaborator Author

@herkolategan herkolategan left a comment

Choose a reason for hiding this comment

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

At the moment all callers are passing 0. Is there an imminent use-case where it would be non-zero?
At the moment there is one roachtest which will use this to start multiple instances on a single VM of the same virtual cluster. But since it's used scarcely, we have discussed using a struct for virtual cluster name and instance to alleviate that.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @smg260)


pkg/cmd/roachtest/tests/drain.go line 246 at r1 (raw file):

Previously, srosenberg (Stan Rosenberg) wrote…

Nit: /* sqlInstance */ 0 [1]

[1] https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/1881669848/Go+function+argument+patterns#Naive-style%3A-%E2%80%9Crequire-everything%E2%80%9D

Done.

@herkolategan
Copy link
Copy Markdown
Collaborator Author

TFTRs!
bors r=renatolabs

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 9, 2023

Build succeeded:

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