Skip to content

Commit

Permalink
CBG-4223 correct log message (#7101)
Browse files Browse the repository at this point in the history
  • Loading branch information
torcolvin authored Sep 4, 2024
1 parent 6d848a9 commit 51c00da
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
17 changes: 17 additions & 0 deletions base/redactable_string.go
Original file line number Diff line number Diff line change
@@ -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...)
}
5 changes: 3 additions & 2 deletions rest/config_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
)
Expand Down

0 comments on commit 51c00da

Please sign in to comment.