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

server: sanitize the behavior of runtime stats sampling / dumps for secondary tenants #96168

Merged
merged 3 commits into from
Jan 31, 2023

Conversation

knz
Copy link
Contributor

@knz knz commented Jan 30, 2023

Fixes #84589.
Epic: CRDB-14537

See the individual commits for details.

This was a simple mistake the first time the code was written.

Release note: None
@knz knz added the A-multitenancy Related to multi-tenancy label Jan 30, 2023
@knz knz requested review from stevendanna, dhartunian and a team January 30, 2023 09:04
@knz knz requested review from a team as code owners January 30, 2023 09:04
@blathers-crl
Copy link

blathers-crl bot commented Jan 30, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@stevendanna stevendanna left a comment

Choose a reason for hiding this comment

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

Overall the code looks reasonable.

A test here could be hard to make non-flaky, but if we did want to try one, I think the most interesting one to me would be ensuring that we can see the relevant runtime stats from inside the tenant.

Copy link
Collaborator

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

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

:lgtm:

There's already a test in tenant_vars_test.go that exercises the runtime stats on the tenant. If that test can be amended to use an in-process tenant, it should cover it.

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

knz added 2 commits January 30, 2023 17:28
Prior to this patch, the process-wide metrics were being sampled by
each tenant server. This is unnecessary: they are process-wide so they
can be sampled only once.

Release note: None
Prior to this patch, in-flight trace dumps were disabled for secondary
tenant servers. This patch re-enables them. The traces are written to
a sub-directory of the configured job trace dump
directory (`inflight_trace_dump` in the configured log directory).

Release note: None
@knz knz force-pushed the 20230130-sample branch from 332df36 to f3bece9 Compare January 30, 2023 16:28
@knz
Copy link
Contributor Author

knz commented Jan 30, 2023

If that test can be amended to use an in-process tenant, it should cover it.

Great idea. Done.

@knz
Copy link
Contributor Author

knz commented Jan 30, 2023

bors r=stevendanna,dhartunian

@craig
Copy link
Contributor

craig bot commented Jan 30, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 30, 2023

Build failed (retrying...):

@knz
Copy link
Contributor Author

knz commented Jan 31, 2023

bors r=stevendanna,dhartunian

@craig
Copy link
Contributor

craig bot commented Jan 31, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 31, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 31, 2023

Build succeeded:

@craig craig bot merged commit c410d8d into cockroachdb:master Jan 31, 2023
@knz knz deleted the 20230130-sample branch January 31, 2023 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-multitenancy Related to multi-tenancy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server: extract the call to startSampleEnvironment() from StartTenant/StartServer [CRDB-14537 followup]
4 participants