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

bench: fix tenant benchmark #93616

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Conversation

renatolabs
Copy link
Contributor

Fixes argument passed to crdb_internal.create_tenant to remove underscore, which is rejected as an invalid name; and also use the bench database in tenantDB.

Relates to #93530.

Epic: none
Release note: None

@renatolabs renatolabs requested review from andreimatei and a team December 14, 2022 16:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@renatolabs
Copy link
Contributor Author

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

Copy link
Contributor

@andreimatei andreimatei 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 fixing this, I just noticed the failures.
Do you know if not accepting underscores is a new thing? Cause this worked yesterday...

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


pkg/bench/foreachdb.go line 72 at r1 (raw file):

	// Get a SQL connection to the test tenant.
	sqlAddr := s.(*server.TestServer).TestingGetSQLAddrForTenant(ctx, tenantName)
	tenantDB := serverutils.OpenDBConn(b, sqlAddr, "bench", false, s.Stopper())

does this database exist for the tenant?

Copy link
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

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


pkg/bench/foreachdb.go line 60 at r1 (raw file):

	s, db, _ := serverutils.StartServer(
		b, base.TestServerArgs{
			UseDatabase:              "bench",

remove this pls. Unless it somehow affects the tenant and is the reason why the db is created in the tenant?

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

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


pkg/bench/foreachdb.go line 60 at r1 (raw file):

Previously, andreimatei (Andrei Matei) wrote…

remove this pls. Unless it somehow affects the tenant and is the reason why the db is created in the tenant?

We would need to augment all benchmarks too because queries there do hard-code bench.<table_name>.

Copy link
Contributor

@andreimatei andreimatei 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! 2 of 0 LGTMs obtained (waiting on @renatolabs and @yuzefovich)


pkg/bench/foreachdb.go line 60 at r1 (raw file):

Previously, yuzefovich (Yahor Yuzefovich) wrote…

We would need to augment all benchmarks too because queries there do hard-code bench.<table_name>.

This only affects connections returned from this node, which are no longer used by the benchmarks. The benchmarks uise the pool created below, where the "bench" db is added to the URL in this patch.
Although the benchmarks appeared to work without it in the URL too. Or perhaps I had just ran BenchmarkSQL and not others.


pkg/bench/foreachdb.go line 72 at r1 (raw file):

Previously, andreimatei (Andrei Matei) wrote…

does this database exist for the tenant?

oh the db is created below, nvm me

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @andreimatei and @renatolabs)


pkg/bench/foreachdb.go line 60 at r1 (raw file):

Previously, andreimatei (Andrei Matei) wrote…

This only affects connections returned from this node, which are no longer used by the benchmarks. The benchmarks uise the pool created below, where the "bench" db is added to the URL in this patch.
Although the benchmarks appeared to work without it in the URL too. Or perhaps I had just ran BenchmarkSQL and not others.

Oh, I think I misunderstood your suggestion - I thought you were saying to not use bench database and let everything run in defaultdb, nvm.

Copy link
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

Do you know if not accepting underscores is a new thing? Cause this worked yesterday...

Ah, it must have been this #93269
Btw, I think there used to be a time where benchmarks were run (maybe with benchtime=1x in CI) to prevent things like this. Now this (or at least something that fails) seems to be in Bazel extended. Perhaps we could move it?

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @renatolabs)

@renatolabs
Copy link
Contributor Author

Perhaps we could move it?

There's some discussion in this link (internal).

TFTRs!

bors r=yuzefovich,andreimatei

Copy link
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @renatolabs and @yuzefovich)


pkg/bench/foreachdb.go line 60 at r1 (raw file):

Previously, yuzefovich (Yahor Yuzefovich) wrote…

Oh, I think I misunderstood your suggestion - I thought you were saying to not use bench database and let everything run in defaultdb, nvm.

Please remove this line; it's broken to the extent that it matters.

@renatolabs
Copy link
Contributor Author

bors r-

@craig
Copy link
Contributor

craig bot commented Dec 14, 2022

Canceled.

Fixes argument passed to `crdb_internal.create_tenant` to remove
underscore, which is rejected as an invalid name; and also use the
`bench` database in `tenantDB`.

Relates to cockroachdb#93530.

Epic: none
Release note: None
Copy link
Contributor Author

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @andreimatei and @yuzefovich)


pkg/bench/foreachdb.go line 60 at r1 (raw file):

Previously, andreimatei (Andrei Matei) wrote…

Please remove this line; it's broken to the extent that it matters.

Done.

Copy link
Contributor

@andreimatei andreimatei 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 (and 1 stale) (waiting on @renatolabs and @yuzefovich)

@renatolabs
Copy link
Contributor Author

bors r=yuzefovich,andreimatei

@craig
Copy link
Contributor

craig bot commented Dec 14, 2022

Build succeeded:

@craig craig bot merged commit dbea195 into cockroachdb:master Dec 14, 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