Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
95091: security: add option to re-enable old cipher suites r=catj-cockroach a=catj-cockroach

In #82362 we updated the list of cipher suites to match the "recommended" cipher suites defined in RFC 8447. As noted in that PR, very old clients may fail to connect.

For systems using those very old clients, this PR adds a setting that can be used to re-enable the "old" cipher suites removed in that PR.

Release note (security update): adds option to re-enable "old" cipher suites for use with very old clients.

95243: storage: disallow nil settings in StorageConfig r=RaduBerinde a=RaduBerinde

Tolerating nil settings is tedious and error-prone. We don't want these settings to be unset in production paths. This change makes it non-optional.

Release note: None

95548: cluster-ui: use absolute path in node selector import r=xinhaoz a=xinhaoz

Previously, the import path for accumulateMetrics in `nodes.selector.ts` was using a relative path. This for some reason broke the session details page on CC for 23.1.

Epic: none

Release note: None


https://www.loom.com/share/d315f2a605254701b91fc189213b0e41

95689: schemachanger: small fixes and tweaks r=postamar a=postamar

These commits consist of straightforward changes to the declarative schema changer which were spun off from work on #88294 but which are required for it.

Informs #88294.

Release note: None

95694: batcheval: modify MVCCStats CleanRange assertion under race r=adityamaru a=adityamaru

Previously, if ClearRange took a fast path and was being tested under race, then we would assert that the computed MVCCStats were the same as those of the fast path. This would not be true if the MVCCStats contained estimates which they do in operation such as cluster to cluster replication.

This change tweaks the assertion to only run if the MVCCStats do not contain estimates since if they do there is no guarantee they will match up with the computed MVCCStats.

Fixes: #95656
Fixes: #95677

Release note: None

Co-authored-by: Cat J <[email protected]>
Co-authored-by: Radu Berinde <[email protected]>
Co-authored-by: Xin Hao Zhang <[email protected]>
Co-authored-by: Marius Posta <[email protected]>
Co-authored-by: adityamaru <[email protected]>
  • Loading branch information
6 people committed Jan 23, 2023
6 parents 479e5aa + b9fbbbc + 136ef1b + 568084a + 463528e + 1305c74 commit efd23f5
Show file tree
Hide file tree
Showing 407 changed files with 803 additions and 628 deletions.
2 changes: 1 addition & 1 deletion pkg/base/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ type StorageConfig struct {
// BallastSize is the amount reserved by a ballast file for manual
// out-of-disk recovery.
BallastSize int64
// Settings instance for cluster-wide knobs.
// Settings instance for cluster-wide knobs. Must not be nil.
Settings *cluster.Settings
// UseFileRegistry is true if the file registry is needed (eg: encryption-at-rest).
// This may force the store version to versionFileRegistry if currently lower.
Expand Down
1 change: 1 addition & 0 deletions pkg/ccl/cliccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ go_test(
"//pkg/ccl/storageccl/engineccl",
"//pkg/cli",
"//pkg/server",
"//pkg/settings/cluster",
"//pkg/storage",
"//pkg/testutils/serverutils",
"//pkg/util/envutil",
Expand Down
5 changes: 3 additions & 2 deletions pkg/ccl/cliccl/ear_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
// NewEncryptedEnvFunc in `pkg/storage`.
_ "github.com/cockroachdb/cockroach/pkg/ccl/storageccl/engineccl"
"github.com/cockroachdb/cockroach/pkg/cli"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/util/envutil"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
Expand Down Expand Up @@ -49,7 +50,7 @@ func TestDecrypt(t *testing.T) {
require.NoError(t, err)
encOpts, err := encSpec.ToEncryptionOptions()
require.NoError(t, err)
p, err := storage.Open(ctx, storage.Filesystem(dir), storage.EncryptionAtRest(encOpts))
p, err := storage.Open(ctx, storage.Filesystem(dir), cluster.MakeClusterSettings(), storage.EncryptionAtRest(encOpts))
require.NoError(t, err)

// Find a manifest file to check.
Expand Down Expand Up @@ -128,7 +129,7 @@ func TestList(t *testing.T) {
require.NoError(t, err)
encOpts, err := encSpec.ToEncryptionOptions()
require.NoError(t, err)
p, err := storage.Open(ctx, storage.Filesystem(dir), storage.EncryptionAtRest(encOpts))
p, err := storage.Open(ctx, storage.Filesystem(dir), cluster.MakeClusterSettings(), storage.EncryptionAtRest(encOpts))
require.NoError(t, err)

// Write a key and flush, to create a table in the store.
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/schemachangerccl/testdata/explain/create_index
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EXPLAIN (ddl) CREATE INDEX id1
STORING (money)
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
----
Schema change plan for CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
├── StatementPhase
│ └── Stage 1 of 1 in StatementPhase
│ ├── 7 elements transitioning toward PUBLIC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl) rollback at post-commit stage 1 of 7;
----
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── PostCommitNonRevertiblePhase
└── Stage 1 of 1 in PostCommitNonRevertiblePhase
├── 12 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl) rollback at post-commit stage 2 of 7;
----
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── PostCommitNonRevertiblePhase
├── Stage 1 of 2 in PostCommitNonRevertiblePhase
│ ├── 11 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl) rollback at post-commit stage 3 of 7;
----
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── PostCommitNonRevertiblePhase
├── Stage 1 of 2 in PostCommitNonRevertiblePhase
│ ├── 11 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl) rollback at post-commit stage 4 of 7;
----
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── PostCommitNonRevertiblePhase
├── Stage 1 of 2 in PostCommitNonRevertiblePhase
│ ├── 11 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl) rollback at post-commit stage 5 of 7;
----
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── PostCommitNonRevertiblePhase
├── Stage 1 of 2 in PostCommitNonRevertiblePhase
│ ├── 11 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl) rollback at post-commit stage 6 of 7;
----
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── PostCommitNonRevertiblePhase
├── Stage 1 of 2 in PostCommitNonRevertiblePhase
│ ├── 11 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl) rollback at post-commit stage 7 of 7;
----
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── PostCommitNonRevertiblePhase
├── Stage 1 of 2 in PostCommitNonRevertiblePhase
│ ├── 11 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE multi_region_test_db.public.table_regional_by_table (
/* test */
EXPLAIN (ddl) DROP DATABASE multi_region_test_db CASCADE;
----
Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
├── StatementPhase
│ └── Stage 1 of 1 in StatementPhase
│ ├── 9 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE multi_region_test_db.public.table_regional_by_row (
/* test */
EXPLAIN (ddl) DROP TABLE multi_region_test_db.public.table_regional_by_row;
----
Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row›;
Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row›;
├── StatementPhase
│ └── Stage 1 of 1 in StatementPhase
│ ├── 6 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE multi_region_test_db.public.table_regional_by_table (
/* test */
EXPLAIN (ddl) DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE;
----
Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE;
Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE;
├── StatementPhase
│ └── Stage 1 of 1 in StatementPhase
│ ├── 5 elements transitioning toward ABSENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EXPLAIN (ddl, verbose) CREATE INDEX id1
STORING (money)
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
----
• Schema change plan for CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for CREATE INDEX ‹id1› ON ‹defaultdb›.‹public›.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
├── • StatementPhase
│ │
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl, verbose) rollback at post-commit stage 1 of 7;
----
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── • PostCommitNonRevertiblePhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl, verbose) rollback at post-commit stage 2 of 7;
----
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── • PostCommitNonRevertiblePhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl, verbose) rollback at post-commit stage 3 of 7;
----
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── • PostCommitNonRevertiblePhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl, verbose) rollback at post-commit stage 4 of 7;
----
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── • PostCommitNonRevertiblePhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl, verbose) rollback at post-commit stage 5 of 7;
----
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── • PostCommitNonRevertiblePhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl, verbose) rollback at post-commit stage 6 of 7;
----
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── • PostCommitNonRevertiblePhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CREATE INDEX id1
PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1));
EXPLAIN (ddl, verbose) rollback at post-commit stage 7 of 7;
----
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
• Schema change plan for rolling back CREATE INDEX ‹id1› ON ‹defaultdb›.public.‹t1› (‹id›, ‹name›) STORING (‹money›) PARTITION BY LIST (‹id›) (PARTITION ‹p1› VALUES IN (‹1›));
└── • PostCommitNonRevertiblePhase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE multi_region_test_db.public.table_regional_by_table (
/* test */
EXPLAIN (ddl, verbose) DROP DATABASE multi_region_test_db CASCADE;
----
• Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
• Schema change plan for DROP DATABASE ‹multi_region_test_db› CASCADE;
├── • StatementPhase
│ │
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE multi_region_test_db.public.table_regional_by_row (
/* test */
EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_row;
----
• Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row›;
• Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_row›;
├── • StatementPhase
│ │
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE multi_region_test_db.public.table_regional_by_table (
/* test */
EXPLAIN (ddl, verbose) DROP TABLE multi_region_test_db.public.table_regional_by_table CASCADE;
----
• Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE;
• Schema change plan for DROP TABLE ‹multi_region_test_db›.‹public›.‹table_regional_by_table› CASCADE;
├── • StatementPhase
│ │
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/storageccl/engineccl/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func loadTestData(
eng, err := storage.Open(
ctx,
storage.Filesystem(dir),
storage.Settings(cluster.MakeTestingClusterSettings()))
cluster.MakeTestingClusterSettings())
if err != nil {
return nil, err
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/ccl/storageccl/engineccl/encrypted_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ func TestPebbleEncryption(t *testing.T) {
context.Background(),
storage.PebbleConfig{
StorageConfig: base.StorageConfig{
Settings: cluster.MakeTestingClusterSettings(),
Attrs: roachpb.Attributes{},
MaxSize: 512 << 20,
UseFileRegistry: true,
Expand Down Expand Up @@ -380,6 +381,7 @@ func TestPebbleEncryption2(t *testing.T) {
context.Background(),
storage.PebbleConfig{
StorageConfig: base.StorageConfig{
Settings: cluster.MakeTestingClusterSettings(),
Attrs: roachpb.Attributes{},
MaxSize: 512 << 20,
UseFileRegistry: true,
Expand Down
5 changes: 3 additions & 2 deletions pkg/cli/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@ func OpenEngine(
if err != nil {
return nil, err
}
db, err := storage.Open(context.Background(),
db, err := storage.Open(
context.Background(),
storage.Filesystem(dir),
serverCfg.Settings,
storage.MaxOpenFiles(int(maxOpenFiles)),
storage.CacheSize(server.DefaultCacheSize),
storage.Settings(serverCfg.Settings),
storage.Hook(PopulateStorageConfigHook),
storage.CombineOptions(opts...))
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/debug_check_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/stateloader"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
Expand Down Expand Up @@ -83,6 +84,7 @@ func TestDebugCheckStore(t *testing.T) {
func() {
eng, err := storage.Open(ctx,
storage.Filesystem(storePaths[0]),
cluster.MakeClusterSettings(),
storage.CacheSize(10<<20 /* 10 MiB */),
storage.MustExist)
require.NoError(t, err)
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/gossip"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/server"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/testutils"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
Expand All @@ -37,6 +38,7 @@ func createStore(t *testing.T, path string) {
db, err := storage.Open(
context.Background(),
storage.Filesystem(path),
cluster.MakeClusterSettings(),
storage.CacheSize(server.DefaultCacheSize))
if err != nil {
t.Fatal(err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/syncbench/syncbench.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ func Run(opts Options) error {
db, err := storage.Open(
context.Background(),
storage.Filesystem(opts.Dir),
storage.CacheSize(0),
storage.Settings(cluster.MakeTestingClusterSettings()))
cluster.MakeTestingClusterSettings(),
storage.CacheSize(0))
if err != nil {
return err
}
Expand Down
10 changes: 7 additions & 3 deletions pkg/kv/kvserver/batcheval/cmd_clear_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,14 @@ func computeStatsDelta(
if err != nil {
return enginepb.MVCCStats{}, err
}
// If we took the fast path but race is enabled, assert stats were correctly computed.
// If we took the fast path but race is enabled, assert stats were correctly
// computed.
if entireRange {
computed.ContainsEstimates = delta.ContainsEstimates // retained for tests under race
if !delta.Equal(computed) {
// Retain the value of ContainsEstimates for tests under race.
computed.ContainsEstimates = delta.ContainsEstimates
// We only want to assert the correctness of stats that do not contain
// estimates.
if delta.ContainsEstimates == 0 && !delta.Equal(computed) {
log.Fatalf(ctx, "fast-path MVCCStats computation gave wrong result: diff(fast, computed) = %s",
pretty.Diff(delta, computed))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/batcheval/cmd_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ func TestRandomKeyAndTimestampExport(t *testing.T) {
st := cluster.MakeTestingClusterSettings()
mkEngine := func(t *testing.T) (e storage.Engine, cleanup func()) {
dir, cleanupDir := testutils.TempDir(t)
e, err := storage.Open(ctx, storage.Filesystem(dir), storage.CacheSize(0), storage.Settings(st))
e, err := storage.Open(ctx, storage.Filesystem(dir), st, storage.CacheSize(0))
if err != nil {
t.Fatal(err)
}
Expand Down
Loading

0 comments on commit efd23f5

Please sign in to comment.