summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/sharding_state.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-01-19 16:24:05 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-01-24 13:45:53 -0500
commitbc433b50e0205dfd0a8bfb6906393d841fd8193a (patch)
tree969334ca08f56dd05254f4aa10b69d74dc080e65 /src/mongo/db/s/sharding_state.cpp
parentfbf03e93dad1d2d081944c05436e777380873eb2 (diff)
downloadmongo-bc433b50e0205dfd0a8bfb6906393d841fd8193a.tar.gz
SERVER-28670 Add sharding CatalogCache and donor metrics to serverStatus
Includes metrics for refresh, clone and migration critical section duration.
Diffstat (limited to 'src/mongo/db/s/sharding_state.cpp')
-rw-r--r--src/mongo/db/s/sharding_state.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/db/s/sharding_state.cpp b/src/mongo/db/s/sharding_state.cpp
index 81a60c2be60..77298091f12 100644
--- a/src/mongo/db/s/sharding_state.cpp
+++ b/src/mongo/db/s/sharding_state.cpp
@@ -49,6 +49,7 @@
#include "mongo/db/s/operation_sharding_state.h"
#include "mongo/db/s/sharded_connection_info.h"
#include "mongo/db/s/sharding_initialization_mongod.h"
+#include "mongo/db/s/sharding_statistics.h"
#include "mongo/db/s/type_shard_identity.h"
#include "mongo/executor/network_interface_factory.h"
#include "mongo/executor/network_interface_thread_pool.h"
@@ -225,6 +226,8 @@ Status ShardingState::onStaleShardVersion(OperationContext* opCtx,
LOG(2) << "metadata refresh requested for " << nss.ns() << " at shard version "
<< expectedVersion;
+ ShardingStatistics::get(opCtx).countStaleConfigErrors.addAndFetch(1);
+
// Ensure any ongoing migrations have completed
auto& oss = OperationShardingState::get(opCtx);
oss.waitForMigrationCriticalSectionSignal(opCtx);