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

server: fix some logging output related to configuration #72436

Merged
merged 2 commits into from
Nov 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/cockroachdb/errors"
"github.com/cockroachdb/pebble"
"github.com/cockroachdb/pebble/vfs"
"github.com/cockroachdb/redact"
)

// Context defaults.
Expand Down Expand Up @@ -477,7 +478,7 @@ func (cfg *Config) CreateEngines(ctx context.Context) (Engines, error) {
return Engines{}, errors.Errorf("engines already created")
}
cfg.enginesCreated = true
details := []string{fmt.Sprintf("Pebble cache size: %s", humanizeutil.IBytes(cfg.CacheSize))}
details := []redact.RedactableString{redact.Sprintf("Pebble cache size: %s", redact.SafeString(humanizeutil.IBytes(cfg.CacheSize)))}
pebbleCache := pebble.NewCache(cfg.CacheSize)
defer pebbleCache.Unref()

Expand Down Expand Up @@ -520,8 +521,8 @@ func (cfg *Config) CreateEngines(ctx context.Context) (Engines, error) {
return Engines{}, errors.Errorf("%f%% of memory is only %s bytes, which is below the minimum requirement of %s",
spec.Size.Percent, humanizeutil.IBytes(sizeInBytes), humanizeutil.IBytes(base.MinimumStoreSize))
}
details = append(details, fmt.Sprintf("store %d: in-memory, size %s",
i, humanizeutil.IBytes(sizeInBytes)))
details = append(details, redact.Sprintf("store %d: in-memory, size %s",
i, redact.SafeString(humanizeutil.IBytes(sizeInBytes))))
if spec.StickyInMemoryEngineID != "" {
if cfg.TestingKnobs.Server == nil {
return Engines{}, errors.AssertionFailedf("Could not create a sticky " +
Expand Down Expand Up @@ -569,8 +570,8 @@ func (cfg *Config) CreateEngines(ctx context.Context) (Engines, error) {
spec.Size.Percent, spec.Path, humanizeutil.IBytes(sizeInBytes), humanizeutil.IBytes(base.MinimumStoreSize))
}

details = append(details, fmt.Sprintf("store %d: RocksDB, max size %s, max open file limit %d",
i, humanizeutil.IBytes(sizeInBytes), openFileLimitPerStore))
details = append(details, redact.Sprintf("store %d: max size %s, max open file limit %d",
i, redact.SafeString(humanizeutil.IBytes(sizeInBytes)), openFileLimitPerStore))

storageConfig := base.StorageConfig{
Attrs: spec.Attributes,
Expand Down