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: add cluster settings operations #123806

Merged

Conversation

herkolategan
Copy link
Collaborator

This change adds operations to mutate cluster settings. The values are mutated
based on a preset frequency and RNG. For example, if the frequency of a cluster
setting operation is set to "30 minutes" it will only change to a new value
every 30 minutes, even if the operation has been run multiple times within the
same 30-minute window. Running in the same window will just set the same value
again.

Epic: None
Release Note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@herkolategan herkolategan force-pushed the hbl/roachtest-ops-cluster-settings branch 4 times, most recently from 3100868 to 1324f13 Compare May 9, 2024 10:41
@herkolategan herkolategan marked this pull request as ready for review May 9, 2024 13:25
@herkolategan herkolategan requested a review from a team as a code owner May 9, 2024 13:25
@herkolategan herkolategan requested review from DarrylWong, renatolabs and itsbilal and removed request for a team May 9, 2024 13:25
@herkolategan herkolategan force-pushed the hbl/roachtest-ops-cluster-settings branch from 1324f13 to 45a1d68 Compare May 9, 2024 13:27
@srosenberg srosenberg self-requested a review May 9, 2024 17:37
@@ -29,7 +29,7 @@ func CheckDependencies(
for _, dep := range spec.Dependencies {
switch dep {
case registry.OperationRequiresNodes:
if len(c.Nodes()) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

It's counter-intuitive that c.Nodes() denotes the empty set (of nodes). We should probably update the API; my quick audit of all the callers didn't yield any other than the above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, took me a few to realise why OperationRequiresNodes wasn't working.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for catching this!

Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

LGTM

}
}

// timeBasedValues returns a function that returns a value from the given list
Copy link
Member

Choose a reason for hiding this comment

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

nice!

{
Name: "kv.expiration_leases_only.enabled",
Generator: timeBasedValues(timeSupplier, []string{"true", "false"}, 24*7*time.Minute),
Owner: registry.OwnerTestEng,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the owner for this should be KV?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that makes sense. I'll update the owner.

return fmt.Sprintf("%d", rng.Intn(246)+5)
}),
Owner: registry.OwnerTestEng,
},
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should add one for kv.snapshot_receiver.excise.enabled as well, but I'm good with this as a follow-up change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea, merging this one for now. Will create a follow-up PR with some additional cluster settings, I have some others in mind as well.

@@ -29,7 +29,7 @@ func CheckDependencies(
for _, dep := range spec.Dependencies {
switch dep {
case registry.OperationRequiresNodes:
if len(c.Nodes()) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for catching this!

This change adds operations to mutate cluster settings. The values are mutated
based on a preset frequency and RNG. For example, if the frequency of a cluster
setting operation is set to "30 minutes" it will only change to a new value
every 30 minutes, even if the operation has been run multiple times within the
same 30-minute window. Running in the same window will just set the same value
again.

Epic: None
Release Note: None
Epic: None
Release Notes: None
@herkolategan herkolategan force-pushed the hbl/roachtest-ops-cluster-settings branch from 45a1d68 to 1beef0c Compare May 16, 2024 05:14
@herkolategan
Copy link
Collaborator Author

TFTR!

bors r=itsbilal

@craig craig bot merged commit 021c72a into cockroachdb:master May 16, 2024
22 checks passed
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