diff options
author | Paolo Polato <paolo.polato@mongodb.com> | 2021-11-05 08:32:09 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-11-05 08:55:47 +0000 |
commit | 02d158c3b2dffbe90e84599739ca05563b5c378b (patch) | |
tree | c19684eef24e6f37c7dd936bd08350f075b447ad /src | |
parent | d3c7f66ab934f19a9f6f22febcb4b27c1e7eaa06 (diff) | |
download | mongo-02d158c3b2dffbe90e84599739ca05563b5c378b.tar.gz |
SERVER-61183 improve logging in migration source cloner
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp index dc9791d7b3c..d2489e0db29 100644 --- a/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp +++ b/src/mongo/db/s/migration_chunk_cloner_source_legacy.cpp @@ -1033,23 +1033,29 @@ Status MigrationChunkClonerSourceLegacy::_checkRecipientCloningStatus(OperationC stdx::lock_guard<Latch> sl(_mutex); const std::size_t cloneLocsRemaining = _cloneLocs.size(); + int64_t untransferredModsSizeBytes = _untransferredDeletesCounter * _averageObjectIdSize + + _untransferredUpsertsCounter * _averageObjectSizeForCloneLocs; if (_forceJumbo && _jumboChunkCloneState) { LOGV2(21992, "moveChunk data transfer progress: {response} mem used: {memoryUsedBytes} " - "documents cloned so far: {docsCloned}", + "documents cloned so far: {docsCloned} remaining amount: " + "{untransferredModsSizeBytes}", "moveChunk data transfer progress", "response"_attr = redact(res), "memoryUsedBytes"_attr = _memoryUsed, - "docsCloned"_attr = _jumboChunkCloneState->docsCloned); + "docsCloned"_attr = _jumboChunkCloneState->docsCloned, + "untransferredModsSizeBytes"_attr = untransferredModsSizeBytes); } else { LOGV2(21993, "moveChunk data transfer progress: {response} mem used: {memoryUsedBytes} " - "documents remaining to clone: {docsRemainingToClone}", + "documents remaining to clone: {docsRemainingToClone} estimated remaining size " + "{untransferredModsSizeBytes}", "moveChunk data transfer progress", "response"_attr = redact(res), "memoryUsedBytes"_attr = _memoryUsed, - "docsRemainingToClone"_attr = cloneLocsRemaining); + "docsRemainingToClone"_attr = cloneLocsRemaining, + "untransferredModsSizeBytes"_attr = untransferredModsSizeBytes); } if (res["state"].String() == "steady" && sessionCatalogSourceInCatchupPhase && @@ -1080,11 +1086,8 @@ Status MigrationChunkClonerSourceLegacy::_checkRecipientCloningStatus(OperationC if ((res["state"].String() == "steady" || res["state"].String() == "catchup") && sessionCatalogSourceInCatchupPhase && supportsCriticalSectionDuringCatchUp) { - int64_t estimatedUntransferredModsSize = - _untransferredDeletesCounter * _averageObjectIdSize + - _untransferredUpsertsCounter * _averageObjectSizeForCloneLocs; auto estimatedUntransferredChunkPercentage = - (std::min(_args.getMaxChunkSizeBytes(), estimatedUntransferredModsSize) * 100) / + (std::min(_args.getMaxChunkSizeBytes(), untransferredModsSizeBytes) * 100) / _args.getMaxChunkSizeBytes(); int64_t maxUntransferredSessionsSize = BSONObjMaxUserSize * _args.getMaxChunkSizeBytes() / ChunkSizeSettingsType::kDefaultMaxChunkSizeBytes; @@ -1092,17 +1095,16 @@ Status MigrationChunkClonerSourceLegacy::_checkRecipientCloningStatus(OperationC estimateUntransferredSessionsSize < maxUntransferredSessionsSize) { // The recipient is sufficiently caught-up with the writes on the donor. // Block writes, so that it can drain everything. - LOGV2_DEBUG(5630700, - 1, - "moveChunk data transfer within threshold to allow write blocking", - "_untransferredUpsertsCounter"_attr = _untransferredUpsertsCounter, - "_untransferredDeletesCounter"_attr = _untransferredDeletesCounter, - "_averageObjectSizeForCloneLocs"_attr = _averageObjectSizeForCloneLocs, - "_averageObjectIdSize"_attr = _averageObjectIdSize, - "untransferredSessionDataInBytes"_attr = - estimateUntransferredSessionsSize, - "maxChunksSizeBytes"_attr = _args.getMaxChunkSizeBytes(), - "_sessionId"_attr = _sessionId.toString()); + LOGV2(5630700, + "moveChunk data transfer within threshold to allow write blocking", + "_untransferredUpsertsCounter"_attr = _untransferredUpsertsCounter, + "_untransferredDeletesCounter"_attr = _untransferredDeletesCounter, + "_averageObjectSizeForCloneLocs"_attr = _averageObjectSizeForCloneLocs, + "_averageObjectIdSize"_attr = _averageObjectIdSize, + "untransferredModsSizeBytes"_attr = untransferredModsSizeBytes, + "untransferredSessionDataInBytes"_attr = estimateUntransferredSessionsSize, + "maxChunksSizeBytes"_attr = _args.getMaxChunkSizeBytes(), + "_sessionId"_attr = _sessionId.toString()); return Status::OK(); } } |