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

spec: move machine type, zone, local ssd defaults out of the TestSpec and the registry #111811

Merged
merged 4 commits into from
Oct 15, 2023

Conversation

RaduBerinde
Copy link
Member

This set of commits makes more progress towards #104029 and - more generally - not baking in any flag configuration into the registry itself.

spec: move RoachprodOpts args to separate struct

Epic: none
Release note: None

spec: move default machine type from ClusterSpec to RoachprodClusterConfig

This is much more logical and allows the removal of the parameter from
the registry.

Epic: none
Release note: None

spec: move default zones to RoachprodClusterConfig

Remove the default zones from ClusterSpec (and the registry), and
add it to RoachprodClusterConfig.

Epic: none
Release note: None

spec: move local SSD preference to RoachprodClusterConfig

We change the boolean in the TestSpec to a tri-state (default, prefer
on, disable). This way we can apply the default when creating the
cluster.

Epic: none
Release note: None

@RaduBerinde RaduBerinde requested a review from a team as a code owner October 5, 2023 03:02
@RaduBerinde RaduBerinde requested review from smg260, DarrylWong and srosenberg and removed request for a team October 5, 2023 03:02
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde RaduBerinde changed the title spec: move local SSD preference to RoachprodClusterConfig spec: move machine type, zone, local ssd defaults out of the TestSpec and the registry Oct 5, 2023
@RaduBerinde RaduBerinde force-pushed the global-cluster-params branch 2 times, most recently from 25cf4cb to a34a352 Compare October 9, 2023 23:50
@RaduBerinde RaduBerinde requested review from renatolabs and removed request for smg260 October 12, 2023 15:54
Copy link
Contributor

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

Nice, thanks for doing this!

const (
// LocalSSDDefault is the default mode, when the test does not have any
// preference. A local SSD may or may not be used, depending on --local-ssd
// flag and machine type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sigh, I wish this was simpler. "Default" could be metamorphic but currently it's defined by --local-ssd. The interplay between all of these components (and which one prevails) is pretty arbitrary to me (for example, IMO typically command line flags exist to overrite settings in the code, but in this case, the flag itself is overwritten).

I'd be pretty confused, as a test author. It's hard to reason about when a test is or is not going to use local SSD.

In any case, nothing to change here as this is all existing behaviour; just a rant.

Copy link
Member Author

Choose a reason for hiding this comment

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

And then there is --roachprod-local-ssd which actually does override. I agree, it's a mess. I'd be happy to implement if we decide on a desirable and coherent behavior.

We could make the Default metamorphic unless the --local-ssd (or --local-ssd=false) flag is passed. But yes I'd want to separate those changes from this refactoring PR.

…onfig

This is much more logical and allows the removal of the parameter from
the registry.

Epic: none
Release note: None
Remove the default zones from `ClusterSpec` (and the registry), and
add it to `RoachprodClusterConfig`.

Epic: none
Release note: None
We change the boolean in the TestSpec to a tri-state (default, prefer
on, disable). This way we can apply the default when creating the
cluster.

Epic: none
Release note: None
@RaduBerinde RaduBerinde force-pushed the global-cluster-params branch from a34a352 to 7abfd67 Compare October 15, 2023 21:28
@RaduBerinde
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 15, 2023

Build succeeded:

@craig craig bot merged commit fbbf7ef into cockroachdb:master Oct 15, 2023
3 checks passed
craig bot pushed a commit that referenced this pull request Nov 6, 2023
112078: roachtest: clean up command-line flags r=RaduBerinde a=RaduBerinde

**This PR is only for the last commit. The rest are #111811**

---

#### roachtest: clean up command-line flags

The code around command-line flags is pretty messy: they're defined in
many places; the name and description of a flag are far away from
the variable; the variable names look like local variables and in many
cases it's not obvious we're accessing a global.

This commit moves all flags to a separate subpackage,
`roachtestflags`, making all uses of global flags obvious. We also add
a bit of infrastructure to allow defining all information about a flag
right next to where the variable is declared.

We also provide a `Changed()` function that determines if a flag value
was changed (without the caller having to use the Command or even the
flag name).

There should be no functional changes (just some cosmetic improvements
to the flag usage texts).

Epic: none
Release note: None


113245: kvserver: add metric and log when raft.Storage returns an error r=erikgrinaker a=sumeerbhola

The raft.storage.error metric is incremented on an error, and the error is logged every 30s (across all replicas).

This was motivated by a test cluster that slowed to a crawl because of deliberate data loss, but was hard to diagnose. The metric could be used for alerting, since we don't expect to see transient errors.

Informs #113053

Epic: none

Release note: None

113335: kvpb: delete ErrorDetail message r=nvanbenschoten a=nvanbenschoten

This was unused, so delete it.

The message has been unused since 0c12f6c.

Epic: None
Release note: None

113636: concurrency: recompute wait queues when locking requests drop out  r=nvanbenschoten a=arulajmani

First commit from #112732

----

A locking request must actively wait in a lock's wait queues if:
- it conflicts with any of the lock holders.
- or it conflicts with a lower sequence numbered request already in
the lock's wait queue.

As a result, if a locking request exits a lock's wait queue without
actually acquiring the lock, it may allow other locking requests to
proceed. This patch recomputes wait queues whenever a locking request
exits a lock's wait queues to detect such scenarios and unblock requests
which were actively waiting previously not no longer need to.

Fixes #111144

Release note: None

Co-authored-by: Radu Berinde <[email protected]>
Co-authored-by: sumeerbhola <[email protected]>
Co-authored-by: Nathan VanBenschoten <[email protected]>
Co-authored-by: Arul Ajmani <[email protected]>
@RaduBerinde RaduBerinde deleted the global-cluster-params branch December 11, 2023 14:15
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