summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Pasette <dan@mongodb.com>2020-05-04 22:42:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-12 19:14:44 +0000
commit74d26b93363012f855f5c046e9d77720fc39364a (patch)
treea70d93e29a6fe84907e850b7cdb3cb3b6d3b8afb
parentda437a3b9d4501cc1e9d278d2c7a82663fa051cf (diff)
downloadmongo-74d26b93363012f855f5c046e9d77720fc39364a.tar.gz
SERVER-47913 Redact sharding messages in split chunk and distributed lock acquisition
-rw-r--r--src/mongo/db/s/merge_chunks_command.cpp2
-rw-r--r--src/mongo/db/s/split_chunk.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/s/merge_chunks_command.cpp b/src/mongo/db/s/merge_chunks_command.cpp
index a430a2fac06..83137ad4950 100644
--- a/src/mongo/db/s/merge_chunks_command.cpp
+++ b/src/mongo/db/s/merge_chunks_command.cpp
@@ -81,7 +81,7 @@ void mergeChunks(OperationContext* opCtx,
const BSONObj& maxKey,
const OID& epoch) {
const std::string whyMessage = str::stream() << "merging chunks in " << nss.ns() << " from "
- << minKey << " to " << maxKey;
+ << redact(minKey) << " to " << redact(maxKey);
auto scopedDistLock = uassertStatusOKWithContext(
Grid::get(opCtx)->catalogClient()->getDistLockManager()->lock(
opCtx, nss.ns(), whyMessage, DistLockManager::kSingleLockAttemptTimeout),
diff --git a/src/mongo/db/s/split_chunk.cpp b/src/mongo/db/s/split_chunk.cpp
index d3c0a6908db..031513c9162 100644
--- a/src/mongo/db/s/split_chunk.cpp
+++ b/src/mongo/db/s/split_chunk.cpp
@@ -140,7 +140,8 @@ StatusWith<boost::optional<ChunkRange>> splitChunk(OperationContext* opCtx,
// TODO(SERVER-25086): Remove distLock acquisition from split chunk
//
const std::string whyMessage(
- str::stream() << "splitting chunk " << chunkRange.toString() << " in " << nss.toString());
+ str::stream() << "splitting chunk " << redact(chunkRange.toString()) << " in "
+ << nss.toString());
auto scopedDistLock = Grid::get(opCtx)->catalogClient()->getDistLockManager()->lock(
opCtx, nss.ns(), whyMessage, DistLockManager::kSingleLockAttemptTimeout);
if (!scopedDistLock.isOK()) {