diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2020-03-22 09:45:40 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-23 01:01:43 +0000 |
commit | a4f4a1c5a114960d762198ff37c24ad114f86885 (patch) | |
tree | 2bfbaba89b78b83a1a68aba58c3a49a17fe5d8a7 /src/mongo/s/commands | |
parent | 79a8452b2a813b796059e5eab6c18f685283ce08 (diff) | |
download | mongo-a4f4a1c5a114960d762198ff37c24ad114f86885.tar.gz |
SERVER-46799 Update log messages based on LOGV2 style guide.
Diffstat (limited to 'src/mongo/s/commands')
-rw-r--r-- | src/mongo/s/commands/cluster_move_chunk_cmd.cpp | 12 | ||||
-rw-r--r-- | src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp | 6 | ||||
-rw-r--r-- | src/mongo/s/commands/cluster_split_cmd.cpp | 13 | ||||
-rw-r--r-- | src/mongo/s/commands/flush_router_config_cmd.cpp | 10 |
4 files changed, 24 insertions, 17 deletions
diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp index e2100c23e73..3e29d9f7580 100644 --- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp @@ -116,11 +116,13 @@ public: const auto toStatus = Grid::get(opCtx)->shardRegistry()->getShard(opCtx, toString); if (!toStatus.isOK()) { - std::string msg(str::stream() - << "Could not move chunk in '" << nss.ns() << "' to shard '" << toString - << "' because that shard does not exist"); - LOGV2(22755, "{msg}", "msg"_attr = msg); - uasserted(ErrorCodes::ShardNotFound, msg); + LOGV2_OPTIONS(22755, + {logv2::UserAssertAfterLog(ErrorCodes::ShardNotFound)}, + "Could not move chunk in {namespace} to {toShardId} because that shard" + " does not exist", + "moveChunk destination shard does not exist", + "toShardId"_attr = toString, + "namespace"_attr = nss.ns()); } const auto to = toStatus.getValue(); diff --git a/src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp b/src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp index 616347c5ef6..15b4cfaa188 100644 --- a/src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp +++ b/src/mongo/s/commands/cluster_set_index_commit_quorum_cmd.cpp @@ -87,9 +87,9 @@ public: BSONObj cmdObj = request().toBSON(BSONObj()); LOGV2_DEBUG(22757, 1, - "setIndexCommitQuorum: {request_getNamespace} cmd:{cmdObj}", - "request_getNamespace"_attr = request().getNamespace(), - "cmdObj"_attr = redact(cmdObj)); + "setIndexCommitQuorum", + "namespace"_attr = request().getNamespace(), + "command"_attr = redact(cmdObj)); scatterGatherOnlyVersionIfUnsharded( opCtx, diff --git a/src/mongo/s/commands/cluster_split_cmd.cpp b/src/mongo/s/commands/cluster_split_cmd.cpp index bf5ea113f70..f1c26c6ad34 100644 --- a/src/mongo/s/commands/cluster_split_cmd.cpp +++ b/src/mongo/s/commands/cluster_split_cmd.cpp @@ -255,13 +255,12 @@ public: ChunkRange(chunk->getMin(), chunk->getMax())); LOGV2(22758, - "Splitting chunk {ChunkRange_chunk_getMin_chunk_getMax} in collection {nss_ns} on " - "shard {chunk_getShardId} at key {splitPoint}", - "ChunkRange_chunk_getMin_chunk_getMax"_attr = - redact(ChunkRange(chunk->getMin(), chunk->getMax()).toString()), - "nss_ns"_attr = nss.ns(), - "chunk_getShardId"_attr = chunk->getShardId(), - "splitPoint"_attr = redact(splitPoint)); + "Splitting chunk {chunkRange} in {namespace} on shard {shardId} at key {splitPoint}", + "Splitting chunk", + "chunkRange"_attr = redact(ChunkRange(chunk->getMin(), chunk->getMax()).toString()), + "splitPoint"_attr = redact(splitPoint), + "namespace"_attr = nss.ns(), + "shardId"_attr = chunk->getShardId()); uassertStatusOK( shardutil::splitChunkAtMultiplePoints(opCtx, diff --git a/src/mongo/s/commands/flush_router_config_cmd.cpp b/src/mongo/s/commands/flush_router_config_cmd.cpp index 3e5cc6aedda..5f36955c83e 100644 --- a/src/mongo/s/commands/flush_router_config_cmd.cpp +++ b/src/mongo/s/commands/flush_router_config_cmd.cpp @@ -91,11 +91,17 @@ public: } else { const auto ns = argumentElem.checkAndGetStringData(); if (nsIsDbOnly(ns)) { - LOGV2(22762, "Routing metadata flushed for database {ns}", "ns"_attr = ns); + LOGV2(22762, + "Routing metadata flushed for database {db}", + "Routing metadata flushed for database", + "db"_attr = ns); catalogCache->purgeDatabase(ns); } else { const NamespaceString nss(ns); - LOGV2(22763, "Routing metadata flushed for collection {nss}", "nss"_attr = nss); + LOGV2(22763, + "Routing metadata flushed for collection {namespace}", + "Routing metadata flushed for collection", + "namespace"_attr = nss); catalogCache->purgeCollection(nss); } } |