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-03 15:30:39 +0000 |
commit | 02f0f34d9ab3d1449bad869aabdd478a5de0791d (patch) | |
tree | 58ce678c3d84e728239de197384db3461c7b87a7 | |
parent | 30dff6a113de31eecf54a0721da61f6d3e781ffa (diff) | |
download | mongo-02f0f34d9ab3d1449bad869aabdd478a5de0791d.tar.gz |
SERVER-53187 Fix format in autosplit log messages
-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 77a51d2b9eb..ed28c310c48 100644 --- a/src/mongo/db/s/chunk_splitter.cpp +++ b/src/mongo/db/s/chunk_splitter.cpp @@ -401,11 +401,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 57d4743e93d..aca8d746004 100644 --- a/src/mongo/db/s/split_vector.cpp +++ b/src/mongo/db/s/split_vector.cpp @@ -130,8 +130,8 @@ 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 @@ -205,8 +205,8 @@ 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; @@ -248,8 +248,8 @@ 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; } @@ -273,8 +273,8 @@ 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; } |