diff options
author | Paolo Polato <paolo.polato@mongodb.com> | 2021-06-02 09:29:01 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-08 13:59:26 +0000 |
commit | 1544e5b6f2fea876857db0685985374a859325a1 (patch) | |
tree | cf595f8aac248aaac42564ac16d3234d477075ec | |
parent | 335c011f5e48416ec22eebe415a66a1d9ddb1216 (diff) | |
download | mongo-1544e5b6f2fea876857db0685985374a859325a1.tar.gz |
SERVER-53187 Fix format in autosplit log messages
(cherry picked from commit 02f0f34d9ab3d1449bad869aabdd478a5de0791d)
-rw-r--r-- | src/mongo/db/s/chunk_splitter.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/s/split_vector.cpp | 16 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/mongo/db/s/chunk_splitter.cpp b/src/mongo/db/s/chunk_splitter.cpp index 58a4cb4e0e0..298c6181568 100644 --- a/src/mongo/db/s/chunk_splitter.cpp +++ b/src/mongo/db/s/chunk_splitter.cpp @@ -403,11 +403,13 @@ void ChunkSplitter::_runAutosplit(std::shared_ptr<ChunkSplitStateDriver> chunkSp const bool shouldBalance = isAutoBalanceEnabled(opCtx.get(), nss, balancerConfig); LOGV2(21908, - "autosplitted {namespace} chunk: {chunk} with {splitPoints} split points " - "(maxChunkSizeBytes: {maxChunkSizeBytes}). {extraInfo}", + "autosplitted {namespace} chunk: [{minKey},{maxKey}) with {splitPoints} split points " + "(maxChunkSizeBytes: {maxChunkSizeBytes}, lastmod: {lastmod}). {extraInfo}", "autosplitted chunk", "namespace"_attr = nss, - "chunk"_attr = redact(chunk.toString()), + "minKey"_attr = redact(chunk.getMin()), + "maxKey"_attr = redact(chunk.getMax()), + "lastmod"_attr = redact(chunk.getLastmod().toBSON()), "splitPoints"_attr = splitPoints.size(), "maxChunkSizeBytes"_attr = maxChunkSizeBytes, "extraInfo"_attr = diff --git a/src/mongo/db/s/split_vector.cpp b/src/mongo/db/s/split_vector.cpp index cdccbebb88b..68c55a8df1e 100644 --- a/src/mongo/db/s/split_vector.cpp +++ b/src/mongo/db/s/split_vector.cpp @@ -134,8 +134,8 @@ StatusWith<std::vector<BSONObj>> splitVector(OperationContext* opCtx, "Requested split points lookup for chunk {namespace} {minKey} -->> {maxKey}", "Requested split points lookup for chunk", "namespace"_attr = nss.toString(), - "minKey"_attr = redact(minKey), - "maxKey"_attr = redact(maxKey)); + "minKey"_attr = redact(prettyKey(keyPattern, minKey)), + "maxKey"_attr = redact(prettyKey(keyPattern, maxKey))); // We'll use the average object size and number of object to find approximately how many // keys each chunk should have. We'll split at half the maxChunkSizeBytes or @@ -211,8 +211,8 @@ StatusWith<std::vector<BSONObj>> splitVector(OperationContext* opCtx, "{maxKey} contains only the key {key}", "Possible low cardinality key detected in range. Range contains only a single key.", "namespace"_attr = nss.toString(), - "minKey"_attr = redact(minKey), - "maxKey"_attr = redact(maxKey), + "minKey"_attr = redact(prettyKey(idx->keyPattern(), minKey)), + "maxKey"_attr = redact(prettyKey(idx->keyPattern(), maxKey)), "key"_attr = redact(prettyKey(idx->keyPattern(), currKey))); std::vector<BSONObj> emptyVector; return emptyVector; @@ -254,8 +254,8 @@ StatusWith<std::vector<BSONObj>> splitVector(OperationContext* opCtx, "Max BSON response size reached for split vector before the end " "of chunk", "namespace"_attr = nss.toString(), - "minKey"_attr = redact(minKey), - "maxKey"_attr = redact(maxKey)); + "minKey"_attr = redact(prettyKey(idx->keyPattern(), minKey)), + "maxKey"_attr = redact(prettyKey(idx->keyPattern(), maxKey))); break; } @@ -279,8 +279,8 @@ StatusWith<std::vector<BSONObj>> splitVector(OperationContext* opCtx, "Max number of requested split points reached before the end of chunk", "numSplitPoints"_attr = numChunks, "namespace"_attr = nss.toString(), - "minKey"_attr = redact(minKey), - "maxKey"_attr = redact(maxKey)); + "minKey"_attr = redact(prettyKey(idx->keyPattern(), minKey)), + "maxKey"_attr = redact(prettyKey(idx->keyPattern(), maxKey))); break; } |