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

sql: remove references to closed multi-tenancy issues #111321

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Sep 27, 2023

This commit updates a few places to remove now-closed multi-tenancy
issues. Two of those places are gated behind the system tenant, so the
issue doesn't matter, and they now use existing issue (even though it
doesn't really relate to the features in question). In one place we
choose to return "tenant cluster setting" not enabled error to make it
more clear (I was just bitten by this because we returned opaque
"unimplemented" error). In two other places in comments we update the
references to existing issues tracking the corresponding work.

Informs: #75569.
Epic: None

Release note: None

@blathers-crl
Copy link

blathers-crl bot commented Sep 27, 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

@yuzefovich yuzefovich changed the title WIP on always using secondary tenant for 5node config sql: remove references to closed multi-tenancy issues Sep 27, 2023
@yuzefovich yuzefovich marked this pull request as ready for review September 27, 2023 16:39
@yuzefovich yuzefovich requested a review from a team September 27, 2023 16:39
@yuzefovich yuzefovich requested review from a team as code owners September 27, 2023 16:39
@yuzefovich yuzefovich requested review from ericharmeling, rharding6373, knz, stevendanna and a team and removed request for a team, ericharmeling and rharding6373 September 27, 2023 16:39
Copy link
Member Author

@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! 0 of 0 LGTMs obtained (waiting on @knz and @stevendanna)


pkg/sql/set_zone_config.go line 265 at r1 (raw file):

	if err := execCfg.RequireSystemTenantOrClusterSetting(SecondaryTenantZoneConfigsEnabled); err != nil {
		// Return an unimplemented error here instead of referencing the cluster

I think the change of the returned error here is the only contentious change in this PR. I was surprised by the error returned in shared-process MT mode, so at least in that mode I think we should return err. For separate-process MT it might make sense to return errorutil.*. Curious about your thoughts.

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 8 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @stevendanna and @yuzefovich)


pkg/sql/set_zone_config.go line 265 at r1 (raw file):

Previously, yuzefovich (Yahor Yuzefovich) wrote…

I think the change of the returned error here is the only contentious change in this PR. I was surprised by the error returned in shared-process MT mode, so at least in that mode I think we should return err. For separate-process MT it might make sense to return errorutil.*. Curious about your thoughts.

I think we want to change the error returned by RequireXXX() to not use the word "tenant" and maybe move the name of the cluster setting to the DETAIL payload. That is, instead of

errors.Newf("tenant cluster setting %s disabled", setting.Name())

something like:

errors.WithDetailf(
  errors.WithHint(errors.New("operation is disabled within a virtual cluster",
  "Feature was disabled by the system operator."),
  "Feature flag: %s", setting.Name))

This commit updates a few places to remove now-closed multi-tenancy
issues. Two of those places are gated behind the system tenant, so the
issue doesn't matter, and they now use existing issue (even though it
doesn't really relate to the features in question). In one place we
choose to return "tenant cluster setting" not enabled error to make it
more clear (I was just bitten by this because we returned opaque
"unimplemented" error). In two other places in comments we update the
references to existing issues tracking the corresponding work.

Release note: None
@yuzefovich yuzefovich requested a review from a team as a code owner September 27, 2023 20:11
@yuzefovich yuzefovich requested review from herkolategan and srosenberg and removed request for a team and herkolategan September 27, 2023 20:11
@yuzefovich yuzefovich removed the request for review from srosenberg September 27, 2023 20:12
Copy link
Member Author

@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! 0 of 0 LGTMs obtained (waiting on @knz and @stevendanna)


pkg/sql/set_zone_config.go line 265 at r1 (raw file):

Previously, knz (Raphael 'kena' Poss) wrote…

I think we want to change the error returned by RequireXXX() to not use the word "tenant" and maybe move the name of the cluster setting to the DETAIL payload. That is, instead of

errors.Newf("tenant cluster setting %s disabled", setting.Name())

something like:

errors.WithDetailf(
  errors.WithHint(errors.New("operation is disabled within a virtual cluster",
  "Feature was disabled by the system operator."),
  "Feature flag: %s", setting.Name))

Nice, I like it, done.

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @stevendanna)

@yuzefovich
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 27, 2023

Build succeeded:

@craig craig bot merged commit fcd2f09 into cockroachdb:master Sep 27, 2023
@yuzefovich yuzefovich deleted the zcfg branch September 28, 2023 00:09
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.

3 participants