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

roachtest: assign adminui ports dynamically for virtual clusters #117505

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

DarrylWong
Copy link
Contributor

@DarrylWong DarrylWong commented Jan 8, 2024

This was originally removed in #115599 due to #114097 merging, but adminui was reverted in #117141 and mistakenly did not revert the special case for virtual clusters. We unskip the multitenant/distsql tests as well.

Release note: None
Fixes: #117150
Fixes: #117149
Epic: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@DarrylWong
Copy link
Contributor Author

DarrylWong commented Jan 8, 2024

multitenant/distsql test runs

Ran acceptance/gossip/restart-node-one on gceworker both locally and on gce and confirmed both work.

@DarrylWong DarrylWong force-pushed the multitenant-adminui branch 2 times, most recently from 0631a3f to c5171af Compare January 8, 2024 19:24
@DarrylWong DarrylWong force-pushed the multitenant-adminui branch from c5171af to 433ce79 Compare January 8, 2024 19:42
@DarrylWong DarrylWong marked this pull request as ready for review January 8, 2024 19:56
@DarrylWong DarrylWong requested a review from a team as a code owner January 8, 2024 19:56
@DarrylWong DarrylWong requested review from srosenberg and renatolabs and removed request for a team January 8, 2024 19:56
@renatolabs
Copy link
Contributor

LGTM, but probably worth waiting for #117480 to merge and then unskip those tests in this PR.

@@ -338,7 +339,13 @@ func runGossipRestartNodeOne(ctx context.Context, t test.Test, c cluster.Cluster
settings := install.MakeClusterSettings(install.NumRacksOption(c.Spec().NodeCount))
settings.Env = append(settings.Env, "COCKROACH_SCAN_MAX_IDLE_TIME=5ms")

c.Start(ctx, t.L(), option.DefaultStartOpts(), settings)
// TODO(darrylwong): remove SetDefaultSQLPort once #117125 is addressed.
Copy link
Member

Choose a reason for hiding this comment

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

Given the below assumption, is the TODO still relevant? i.e., if I understood correctly, this test fails if the invariant adminUIPort = SQLPort + 1 doesn't hold, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's true, if we change the port assignment logic then it will fail again.

I changed it to discover the port instead, which seems more correct to me anyway.

Copy link
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.

Thanks!

This was originally removed in cockroachdb#115599 due to cockroachdb#114097 merging,
but adminui was reverted in cockroachdb#117141 and mistakenly did not
revert the special case for virtual clusters.

Release note: None
@DarrylWong DarrylWong force-pushed the multitenant-adminui branch from 433ce79 to fdea06a Compare January 8, 2024 22:55
Copy link
Contributor

@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.

Thanks for the fix! Left small suggestions.

@@ -2490,6 +2490,12 @@ func (c *clusterImpl) ExternalAdminUIAddr(
return c.adminUIAddr(ctx, l, node, true)
}

func (c *clusterImpl) AdminUIPort(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Maybe AdminUIPorts, since this is returning an array of ports?

@@ -2490,6 +2490,12 @@ func (c *clusterImpl) ExternalAdminUIAddr(
return c.adminUIAddr(ctx, l, node, true)
}

func (c *clusterImpl) AdminUIPort(
ctx context.Context, l *logger.Logger, node option.NodeListOption,
Copy link
Contributor

Choose a reason for hiding this comment

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

nodes, since that argument is a collection?

@@ -1074,6 +1074,28 @@ func AdminURL(
return urlGenerator(ctx, c, l, c.TargetNodes(), uConfig)
}

// AdminPort finds the AdminUI ports for a cluster.
func AdminPort(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: plural here too.

for _, node := range c.Nodes {
port, err := c.NodeUIPort(ctx, node)
if err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: might be a good idea to include the node in the error message.

func (c *clusterImpl) AdminUIPort(
ctx context.Context, l *logger.Logger, node option.NodeListOption,
) ([]int, error) {
return roachprod.AdminPort(ctx, l, c.MakeNodes(node), c.localCertsDir != "")
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use c.IsSecure() here.

…e-one

This test relies on assumption `adminUIPort = SQLPort + 1` but adminui is
temporarily hardcoded as 26258 while SQLPort will be dynamically assigned
without the following override. This changes it to discover the port instead
of relying on this assumption.

Release note: None
@DarrylWong DarrylWong force-pushed the multitenant-adminui branch from fdea06a to f6519af Compare January 9, 2024 21:00
@DarrylWong
Copy link
Contributor Author

TFTRs

bors r=srosenberg, renatolabs

@craig
Copy link
Contributor

craig bot commented Jan 10, 2024

This PR was included in a batch that timed out, it will be automatically retried

@craig
Copy link
Contributor

craig bot commented Jan 10, 2024

Build succeeded:

@craig craig bot merged commit 05d1395 into cockroachdb:master Jan 10, 2024
9 checks passed
@yuzefovich
Copy link
Member

blathers backport 23.2

@DarrylWong
Copy link
Contributor Author

blathers backport 23.1

Copy link

blathers-crl bot commented Jan 11, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from ca0d2ed to blathers/backport-release-23.1-117505: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@DarrylWong
Copy link
Contributor Author

blathers backport 23.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants