summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/move_chunk_command.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2019-05-15 13:05:08 -0400
committerJack Mulrow <jack.mulrow@mongodb.com>2019-05-20 11:21:01 -0400
commit90dd9f8983183cb3cb6f7b4a9dfc16ce972655fe (patch)
tree163abe804839d81bebe89936658b13fd1f753193 /src/mongo/db/s/move_chunk_command.cpp
parentbc456b822cc243e63d2e539f11beba9538f11267 (diff)
downloadmongo-90dd9f8983183cb3cb6f7b4a9dfc16ce972655fe.tar.gz
SERVER-40982 Add counters for aborted migrations from lock timeouts
Diffstat (limited to 'src/mongo/db/s/move_chunk_command.cpp')
-rw-r--r--src/mongo/db/s/move_chunk_command.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/s/move_chunk_command.cpp b/src/mongo/db/s/move_chunk_command.cpp
index 10ec850f4b7..dd62c984292 100644
--- a/src/mongo/db/s/move_chunk_command.cpp
+++ b/src/mongo/db/s/move_chunk_command.cpp
@@ -42,6 +42,7 @@
#include "mongo/db/s/migration_source_manager.h"
#include "mongo/db/s/move_timing_helper.h"
#include "mongo/db/s/sharding_state.h"
+#include "mongo/db/s/sharding_statistics.h"
#include "mongo/s/client/shard_registry.h"
#include "mongo/s/grid.h"
#include "mongo/s/request_types/migration_secondary_throttle_options.h"
@@ -142,6 +143,9 @@ public:
status = Status::OK();
} catch (const DBException& e) {
status = e.toStatus();
+ if (status.code() == ErrorCodes::LockTimeout) {
+ ShardingStatistics::get(opCtx).countDonorMoveChunkLockTimeout.addAndFetch(1);
+ }
} catch (const std::exception& e) {
scopedMigration.signalComplete(
{ErrorCodes::InternalError,