diff --git a/base/redactable_string.go b/base/redactable_string.go new file mode 100644 index 0000000000..1a9bc58542 --- /dev/null +++ b/base/redactable_string.go @@ -0,0 +1,17 @@ +// Copyright 2024-Present Couchbase, Inc. +// +// Use of this software is governed by the Business Source License included +// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified +// in that file, in accordance with the Business Source License, use of this +// software will be governed by the Apache License, Version 2.0, included in +// the file licenses/APL2.txt. + +package base + +import "fmt" + +// RedactSprintf is a wrapper around fmt.Sprintf that redacts any sensitive data. +func RedactSprintf(format string, args ...any) string { + redactedArgs := redact(args) + return fmt.Sprintf(format, redactedArgs...) +} diff --git a/rest/config_manager.go b/rest/config_manager.go index dbb8be15d4..b50bff05b4 100644 --- a/rest/config_manager.go +++ b/rest/config_manager.go @@ -519,9 +519,10 @@ func (b *bootstrapContext) waitForConfigDelete(ctx context.Context, bucketName, timeout = b.configRetryTimeout } + dbConfigName := PersistentConfigKey(ctx, groupID, dbName) retryWorker := func() (shouldRetry bool, err error, value interface{}) { config := &DatabaseConfig{} - cas, getErr := b.Connection.GetMetadataDocument(ctx, bucketName, PersistentConfigKey(ctx, groupID, dbName), config) + cas, getErr := b.Connection.GetMetadataDocument(ctx, bucketName, dbConfigName, config) // Success case - delete has been completed if base.IsDocNotFoundError(getErr) { return false, nil, nil @@ -541,7 +542,7 @@ func (b *bootstrapContext) waitForConfigDelete(ctx context.Context, bucketName, // Kick off the retry loop err, retryResult := base.RetryLoop( ctx, - "Wait for config version match", + base.RedactSprintf("Wait for %q to be deleted in %q", base.MD(dbConfigName), base.MD(bucketName)), retryWorker, base.CreateDoublingSleeperDurationFunc(50, timeout), )