summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Tyulenev <misha.tyulenev@mongodb.com>2020-08-03 20:02:33 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-04 18:44:58 +0000
commit07d4e613bd1ecdb1d24358da13869f2b7a92ae4a (patch)
treedf3f4517b6ba2ae22fc90787bb33c85f302bab9b
parent4c4ce2bb432dacd0e771a9eae1572c86e7e0519b (diff)
downloadmongo-07d4e613bd1ecdb1d24358da13869f2b7a92ae4a.tar.gz
SERVER-50047 add debug logging to investigate moveChunk when source == destination
-rw-r--r--src/mongo/db/s/active_migrations_registry.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mongo/db/s/active_migrations_registry.cpp b/src/mongo/db/s/active_migrations_registry.cpp
index d58bcfe9805..fe4fbb55780 100644
--- a/src/mongo/db/s/active_migrations_registry.cpp
+++ b/src/mongo/db/s/active_migrations_registry.cpp
@@ -101,9 +101,24 @@ StatusWith<ScopedDonateChunk> ActiveMigrationsRegistry::registerDonateChunk(
if (_activeMoveChunkState) {
if (_activeMoveChunkState->args == args) {
+ LOGV2(5004704,
+ "registerDonateChunk ",
+ "keys"_attr = ChunkRange(args.getMinKey(), args.getMaxKey()).toString(),
+ "toShardId"_attr = args.getToShardId(),
+ "ns"_attr = args.getNss().ns());
return {ScopedDonateChunk(nullptr, false, _activeMoveChunkState->notification)};
}
+ // TODO: SERVER-50047
+ LOGV2(5004700,
+ "registerDonateChunk ",
+ "currentKeys"_attr = ChunkRange(_activeMoveChunkState->args.getMinKey(),
+ _activeMoveChunkState->args.getMaxKey())
+ .toString(),
+ "currentToShardId"_attr = _activeMoveChunkState->args.getToShardId(),
+ "newKeys"_attr = ChunkRange(args.getMinKey(), args.getMaxKey()).toString(),
+ "newToShardId"_attr = args.getToShardId(),
+ "ns"_attr = args.getNss().ns());
return _activeMoveChunkState->constructErrorStatus();
}
@@ -129,6 +144,13 @@ StatusWith<ScopedReceiveChunk> ActiveMigrationsRegistry::registerReceiveChunk(
}
if (_activeMoveChunkState) {
+ LOGV2(5004701,
+ "registerReceiveChink ",
+ "currentKeys"_attr = ChunkRange(_activeMoveChunkState->args.getMinKey(),
+ _activeMoveChunkState->args.getMaxKey())
+ .toString(),
+ "currentToShardId"_attr = _activeMoveChunkState->args.getToShardId(),
+ "ns"_attr = _activeMoveChunkState->args.getNss().ns());
return _activeMoveChunkState->constructErrorStatus();
}
@@ -177,6 +199,12 @@ BSONObj ActiveMigrationsRegistry::getActiveMigrationStatusReport(OperationContex
void ActiveMigrationsRegistry::_clearDonateChunk() {
stdx::lock_guard<Latch> lk(_mutex);
invariant(_activeMoveChunkState);
+ LOGV2(5004702,
+ "clearDonateChunk ",
+ "currentKeys"_attr = ChunkRange(_activeMoveChunkState->args.getMinKey(),
+ _activeMoveChunkState->args.getMaxKey())
+ .toString(),
+ "currentToShardId"_attr = _activeMoveChunkState->args.getToShardId());
_activeMoveChunkState.reset();
_lockCond.notify_all();
}
@@ -218,6 +246,7 @@ ScopedDonateChunk::~ScopedDonateChunk() {
invariant(*_completionNotification);
_registry->_clearDonateChunk();
}
+ LOGV2(5004703, "~ScopedDonateChunk", "_shouldExecute"_attr = _shouldExecute);
}
ScopedDonateChunk::ScopedDonateChunk(ScopedDonateChunk&& other) {