Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
139744: storage: remove storage-engine flag r=RaduBerinde a=andrewbaptist

The only storage engine for the past 4 years has been pebble. The storage engine is specfied at a node level but applies to the stores. If we want to add something like storage engine back in the future it would be done differently so its easiest to simply remove this for now.

Epic: CRDB-41111

Release note (cli change): This change removes the ``--storage-engine`` parameter from the CLI. It has been deprecated for over 4 years.

Co-authored-by: Andrew Baptist <[email protected]>
  • Loading branch information
craig[bot] and andrewbaptist committed Jan 28, 2025
2 parents 26def9e + e15a172 commit 712e9b2
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 124 deletions.
7 changes: 2 additions & 5 deletions pkg/cli/cliflags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1092,11 +1092,8 @@ See the storage.wal_failover.unhealthy_op_threshold cluster setting.
}

StorageEngine = FlagInfo{
Name: "storage-engine",
Description: `
Storage engine to use for all stores on this cockroach node. The only option is pebble. Deprecated;
only present for backward compatibility.
`,
Name: "storage-engine",
Description: "Deprecated: only present for backward compatibility.",
}

SecondaryCache = FlagInfo{
Expand Down
10 changes: 9 additions & 1 deletion pkg/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ func (f *keyTypeFilter) Set(v string) error {

const backgroundEnvVar = "COCKROACH_BACKGROUND_RESTART"

// This value is never read. It is used to hold the storage engine which is now
// a hidden option.
var deprecatedStorageEngine string

func init() {
initCLIDefaults()

Expand Down Expand Up @@ -507,7 +511,11 @@ func init() {
cliflagcfg.StringFlag(f, &localityFile, cliflags.LocalityFile)

cliflagcfg.VarFlag(f, &storeSpecs, cliflags.Store)
cliflagcfg.VarFlag(f, &serverCfg.StorageEngine, cliflags.StorageEngine)

// deprecatedStorageEngine is only kept for backwards compatibility.
cliflagcfg.StringFlag(f, &deprecatedStorageEngine, cliflags.StorageEngine)
_ = pf.MarkHidden(cliflags.StorageEngine.Name)

cliflagcfg.VarFlag(f, &serverCfg.WALFailover, cliflags.WALFailover)
cliflagcfg.StringFlag(f, &serverCfg.SharedStorage, cliflags.SharedStorage)
cliflagcfg.VarFlag(f, &serverCfg.SecondaryCache, cliflags.SecondaryCache)
Expand Down
7 changes: 0 additions & 7 deletions pkg/cli/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/storage/fs"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/cgroups"
Expand Down Expand Up @@ -613,11 +612,6 @@ func runStartInternal(
return err
}

// Configure the default storage engine.
if serverCfg.StorageEngine == enginepb.EngineTypeDefault {
serverCfg.StorageEngine = enginepb.EngineTypePebble
}

// The configuration is now ready to report to the user and the log
// file. We had to wait after InitNode() so that all configuration
// environment variables, which are reported too, have been read and
Expand Down Expand Up @@ -1241,7 +1235,6 @@ func reportServerInfo(
for i, spec := range serverCfg.Stores.Specs {
buf.Printf("store[%d]:\t%s\n", i, log.SafeManaged(spec))
}
buf.Printf("storage engine: \t%s\n", &serverCfg.StorageEngine)

// Print the commong server identifiers.
if baseCfg.ClusterName != "" {
Expand Down
1 change: 0 additions & 1 deletion pkg/protos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ PROTO_FILES = [
"//pkg/sql/sessiondatapb:session_revival_token.proto",
"//pkg/sql/sqlstats/insights:insights.proto",
"//pkg/sql/types:types.proto",
"//pkg/storage/enginepb:engine.proto",
"//pkg/storage/enginepb:file_registry.proto",
"//pkg/storage/enginepb:mvcc.proto",
"//pkg/storage/enginepb:mvcc3.proto",
Expand Down
6 changes: 0 additions & 6 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/sql/sem/catconstants"
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/storage/disk"
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/storage/fs"
"github.com/cockroachdb/cockroach/pkg/ts"
"github.com/cockroachdb/cockroach/pkg/util"
Expand Down Expand Up @@ -195,10 +194,6 @@ type BaseConfig struct {
// Locality is a description of the topography of the server.
Locality roachpb.Locality

// StorageEngine specifies the engine type (eg. rocksdb, pebble) to use to
// instantiate stores.
StorageEngine enginepb.EngineType

// TestingKnobs is used for internal test controls only.
TestingKnobs base.TestingKnobs

Expand Down Expand Up @@ -319,7 +314,6 @@ func (cfg *BaseConfig) SetDefaults(
cfg.MaxOffset = MaxOffsetType(base.DefaultMaxClockOffset)
cfg.DisableMaxOffsetCheck = false
cfg.DefaultZoneConfig = zonepb.DefaultZoneConfig()
cfg.StorageEngine = storage.DefaultStorageEngine
cfg.WALFailover = base.WALFailoverConfig{Mode: base.WALFailoverDefault}
cfg.TestingInsecureWebAccess = disableWebLogin
cfg.Stores = base.StoreSpecList{
Expand Down
6 changes: 0 additions & 6 deletions pkg/server/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,12 +828,6 @@ func (n *Node) start(
}
})

allEngines := append([]storage.Engine(nil), state.initializedEngines...)
allEngines = append(allEngines, state.uninitializedEngines...)
for _, e := range allEngines {
t := e.Type()
log.Infof(ctx, "started with engine type %v", &t)
}
log.Infof(ctx, "started with attributes %v", attrs.Attrs)

n.startPeriodicLivenessCompaction(n.stopper, livenessRangeCompactInterval)
Expand Down
10 changes: 1 addition & 9 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import (
_ "github.com/cockroachdb/cockroach/pkg/sql/ttl/ttljob" // register jobs declared outside of pkg/sql
_ "github.com/cockroachdb/cockroach/pkg/sql/ttl/ttlschedule" // register schedules declared outside of pkg/sql
"github.com/cockroachdb/cockroach/pkg/storage"
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/ts"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/admission"
Expand Down Expand Up @@ -1851,7 +1850,6 @@ func (s *topLevelServer) PreStart(ctx context.Context) error {
"cluster": s.StorageClusterID().String(),
"node": s.NodeID().String(),
"server_id": fmt.Sprintf("%s-%s", s.StorageClusterID().Short(), s.NodeID()),
"engine_type": s.cfg.StorageEngine.String(),
"encrypted_store": strconv.FormatBool(encryptedStore),
})
})
Expand Down Expand Up @@ -2002,13 +2000,7 @@ func (s *topLevelServer) PreStart(ctx context.Context) error {

// Record node start in telemetry. Get the right counter for this storage
// engine type as well as type of start (initial boot vs restart).
nodeStartCounter := "storage.engine."
switch s.cfg.StorageEngine {
case enginepb.EngineTypeDefault:
fallthrough
case enginepb.EngineTypePebble:
nodeStartCounter += "pebble."
}
nodeStartCounter := "storage.engine.pebble."
if s.InitialStart() {
nodeStartCounter += "initial-boot"
} else {
Expand Down
1 change: 0 additions & 1 deletion pkg/server/server_controller_new_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ func makeSharedProcessTenantServerConfig(
baseCfg.Config.DisableClusterNameVerification = kvServerCfg.Config.DisableClusterNameVerification

baseCfg.MaxOffset = kvServerCfg.BaseConfig.MaxOffset
baseCfg.StorageEngine = kvServerCfg.BaseConfig.StorageEngine
baseCfg.TestingInsecureWebAccess = kvServerCfg.BaseConfig.TestingInsecureWebAccess
baseCfg.Locality = kvServerCfg.BaseConfig.Locality
baseCfg.EnableDemoLoginEndpoint = kvServerCfg.BaseConfig.EnableDemoLoginEndpoint
Expand Down
1 change: 0 additions & 1 deletion pkg/server/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ func (s *SQLServerWrapper) PreStart(ctx context.Context) error {
// to add this information. See below.
sentry.ConfigureScope(func(scope *sentry.Scope) {
scope.SetTags(map[string]string{
"engine_type": s.sqlServer.cfg.StorageEngine.String(),
"encrypted_store": strconv.FormatBool(encryptedStore),
})
})
Expand Down
2 changes: 0 additions & 2 deletions pkg/server/testserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ func makeTestBaseConfig(st *cluster.Settings, tr *tracing.Tracer) BaseConfig {
baseCfg := MakeBaseConfig(st, tr, base.DefaultTestStoreSpec)
// Test servers start in secure mode by default.
baseCfg.Insecure = false
// Configure test storage engine.
baseCfg.StorageEngine = storage.DefaultStorageEngine
// Load test certs. In addition, the tests requiring certs
// need to call securityassets.SetLoader(securitytest.EmbeddedAssets)
// in their init to mock out the file system calls for calls to AssetFS,
Expand Down
10 changes: 0 additions & 10 deletions pkg/storage/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/storage/enginepb"
"github.com/cockroachdb/cockroach/pkg/storage/fs"
"github.com/cockroachdb/cockroach/pkg/storage/pebbleiter"
"github.com/cockroachdb/cockroach/pkg/util/envutil"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/iterutil"
"github.com/cockroachdb/cockroach/pkg/util/log"
Expand All @@ -33,13 +32,6 @@ import (
prometheusgo "github.com/prometheus/client_model/go"
)

// DefaultStorageEngine represents the default storage engine to use.
var DefaultStorageEngine enginepb.EngineType

func init() {
_ = DefaultStorageEngine.Set(envutil.EnvOrDefaultString("COCKROACH_STORAGE_ENGINE", "pebble"))
}

// SimpleMVCCIterator is an interface for iterating over key/value pairs in an
// engine. SimpleMVCCIterator implementations are thread safe unless otherwise
// noted. SimpleMVCCIterator is a subset of the functionality offered by
Expand Down Expand Up @@ -1019,8 +1011,6 @@ type Engine interface {
// in the passed-in keyRanges; reads are not guaranteed to be consistent
// outside of these bounds.
NewEventuallyFileOnlySnapshot(keyRanges []roachpb.Span) EventuallyFileOnlyReader
// Type returns engine type.
Type() enginepb.EngineType
// IngestLocalFiles atomically links a slice of files into the RocksDB
// log-structured merge-tree.
IngestLocalFiles(ctx context.Context, paths []string) error
Expand Down
2 changes: 0 additions & 2 deletions pkg/storage/enginepb/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
proto_library(
name = "enginepb_proto",
srcs = [
"engine.proto",
"file_registry.proto",
"mvcc.proto",
"mvcc3.proto",
Expand Down Expand Up @@ -38,7 +37,6 @@ go_library(
name = "enginepb",
srcs = [
"decode.go",
"engine.go",
"file_registry.go",
"mvcc.go",
"mvcc3.go",
Expand Down
44 changes: 0 additions & 44 deletions pkg/storage/enginepb/engine.go

This file was deleted.

23 changes: 0 additions & 23 deletions pkg/storage/enginepb/engine.proto

This file was deleted.

5 changes: 0 additions & 5 deletions pkg/storage/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -2037,11 +2037,6 @@ func (p *Pebble) NewEventuallyFileOnlySnapshot(keyRanges []roachpb.Span) Eventua
}
}

// Type implements the Engine interface.
func (p *Pebble) Type() enginepb.EngineType {
return enginepb.EngineTypePebble
}

// IngestLocalFiles implements the Engine interface.
func (p *Pebble) IngestLocalFiles(ctx context.Context, paths []string) error {
return p.db.Ingest(ctx, paths)
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/log/logcrash/crash_reporting_packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func TestCrashReportingPacket(t *testing.T) {
}(),
regexp.MustCompile(`crash_reporting_packet_test.go:\d+: panic: boom`),
},
{regexp.MustCompile(`^[a-z0-9]{8}-1$`), 14, func() string {
{regexp.MustCompile(`^[a-z0-9]{8}-1$`), 13, func() string {
message := prefix
// gccgo stack traces are different in the presence of function literals.
if runtime.Compiler == "gccgo" {
Expand Down

0 comments on commit 712e9b2

Please sign in to comment.