Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
92741: Revert "roachtest: update jepsen core to 0.1.19" r=smg260 a=smg260

This reverts commit 4d1b9fc.

See cockroachdb#92743

92767: cli: avoid generating ballast files for standalone SQL servers r=jaylim-crl a=knz

Fixes cockroachdb#92500.

In a previous PR, we merged the startup code path between `cockroach start` and `cockroach mt start-sql`. Doing so also (mostly) merged the default store config. This was incorrect, as standalone SQL servers should not receive an emergency ballast.

This patch fixes that.

Release note: None

Co-authored-by: Miral Gadani <[email protected]>
Co-authored-by: Raphael 'kena' Poss <[email protected]>
  • Loading branch information
3 people committed Nov 30, 2022
3 parents 21ec411 + 99b897f + 61161e1 commit 5ae6412
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions pkg/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1201,5 +1201,17 @@ func mtStartSQLFlagsInit(cmd *cobra.Command) error {
tenantID := fs.Lookup(cliflags.TenantID.Name).Value.String()
serverCfg.Stores.Specs[0].Path += "-tenant-" + tenantID
}

// In standalone SQL servers, we do not generate a ballast file,
// unless a ballast size was specified explicitly by the user.
for i := range serverCfg.Stores.Specs {
spec := &serverCfg.Stores.Specs[i]
if spec.BallastSize == nil {
// Only override if there was no ballast size specified to start
// with.
zero := base.SizeSpec{InBytes: 0, Percent: 0}
spec.BallastSize = &zero
}
}
return nil
}
4 changes: 4 additions & 0 deletions pkg/cli/flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,10 @@ func TestSQLPodStorageDefaults(t *testing.T) {
require.NoError(t, f.Parse(td.args))
require.NoError(t, mtStartSQLCmd.PersistentPreRunE(mtStartSQLCmd, td.args))
assert.Equal(t, td.storePath, serverCfg.Stores.Specs[0].Path)
for _, s := range serverCfg.Stores.Specs {
assert.Zero(t, s.BallastSize.InBytes)
assert.Zero(t, s.BallastSize.Percent)
}
})
}
}
2 changes: 1 addition & 1 deletion pkg/cmd/roachtest/tests/jepsen.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const jepsenRepo = "https://github.com/cockroachdb/jepsen"
const repoBranch = "tc-nightly"

const gcpPath = "https://storage.googleapis.com/cockroach-jepsen"
const binaryVersion = "0.2.0-1150b38f-standalone"
const binaryVersion = "0.1.0-3d7c345d-standalone"

var jepsenNemeses = []struct {
name, config string
Expand Down

0 comments on commit 5ae6412

Please sign in to comment.