Skip to content

closedts: make settings TenantReadOnly and public#108678

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:closedts-settings
Aug 21, 2023
Merged

closedts: make settings TenantReadOnly and public#108678
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:closedts-settings

Conversation

@erikgrinaker
Copy link
Copy Markdown
Contributor

@erikgrinaker erikgrinaker commented Aug 13, 2023

It doesn't make sense for these to be TenantWritable, since the side transport runs below KV. Furthermore, these settings are referenced throughout our documentation, so make them public.

These should really be set only for the system tenant, and secondary tenants could simply read the system tenant's setting. This functionality runs in the host cluster below KV and it doesn't make any sense to set individual settings for tenants here. Unfortunately, this isn't currently possible with the existing settings classes, there is no way for secondary tenants to access the host's settings.

Touches #108677.

Epic: none
Release note (ops change): The following closed timestamp side-transport settings can no longer be set from secondary tenants (they did not have an effect in secondary tenants): kv.closed_timestamp.target_duration, kv.closed_timestamp.side_transport_interval, and kv.closed_timestamp.lead_for_global_reads_override.

@erikgrinaker erikgrinaker requested review from aliher1911 and nvb August 13, 2023 11:28
@erikgrinaker erikgrinaker self-assigned this Aug 13, 2023
@erikgrinaker erikgrinaker requested a review from a team August 13, 2023 11:28
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Aug 13, 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
Copy Markdown
Member

This change is Reviewable

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

We can't easily do this, because stuff like follower_read_timestamp() currently relies on this. It really shouldn't though.

@erikgrinaker erikgrinaker requested review from a team as code owners August 13, 2023 15:51
@erikgrinaker erikgrinaker requested review from lidorcarmel and shermanCRL and removed request for a team, lidorcarmel and shermanCRL August 13, 2023 15:51
@erikgrinaker erikgrinaker changed the title closedts: make settings system-only and public closedts: make settings TenantReadOnly and public Aug 14, 2023
@erikgrinaker erikgrinaker marked this pull request as draft August 15, 2023 07:57
@erikgrinaker
Copy link
Copy Markdown
Contributor Author

Downgrading to draft while I work through the test failures.

@erikgrinaker erikgrinaker force-pushed the closedts-settings branch 3 times, most recently from 71a8886 to aa30d28 Compare August 21, 2023 08:47
@erikgrinaker erikgrinaker force-pushed the closedts-settings branch 3 times, most recently from 7a7129c to 19609d2 Compare August 21, 2023 11:05
@erikgrinaker erikgrinaker marked this pull request as ready for review August 21, 2023 11:58
@erikgrinaker erikgrinaker requested a review from a team as a code owner August 21, 2023 11:58
@erikgrinaker
Copy link
Copy Markdown
Contributor Author

@aliher1911 This should be good to go. It's a prereq for #108667.

cc @nvanbenschoten in case you have opinions on closed timestamp settings.

// TargetDuration is the follower reads closed timestamp update target duration.
var TargetDuration = settings.RegisterDurationSetting(
settings.TenantWritable,
settings.TenantReadOnly,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to call this out as a breaking change? If users are erroneously setting these in their tenants in automation, they will now get an error.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It only affects serverless users. Not sure how we communicate breaking changes there, but release notes don't seem like the best channel. Will find out.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a release note.

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

cc @nvanbenschoten in case you have opinions on closed timestamp settings.

The change here :lgtm:. It's unfortunate that we need to manually fanout the cluster settings when we want to change them on the host, but that isn't changing in this PR and it's still better to not let the setting have write access to the setting.

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

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r+

It doesn't make sense for these to be `TenantWritable`, since the side
transport runs below KV. Furthermore, these settings are referenced
throughout our documentation, so make them public.

These should really be set only for the system tenant, and secondary
tenants could simply read the system tenant's setting. This
functionality runs in the host cluster below KV and it doesn't make any
sense to set individual settings for tenants here. Unfortunately, this
isn't currently possible with the existing settings classes, there is no
way for secondary tenants to access the host's settings.

Epic: none
Release note (ops change): The following closed timestamp side-transport
settings can no longer be set from secondary tenants (they did not have
an effect in secondary tenants): kv.closed_timestamp.target_duration,
kv.closed_timestamp.side_transport_interval, and
kv.closed_timestamp.lead_for_global_reads_override.
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 21, 2023

Canceled.

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

bors r+

@craig craig bot merged commit 604a90a into cockroachdb:master Aug 21, 2023
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 21, 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