MigrationSourceManger is caching the document id of modification during moving chunk.
But I think the threshold of memory usage is too big.
According to the source code, current limit is 5TB. Move chunk command is checking whether the memory usage is greater than 500*1024*1024, but MigrationSourceManager::mbUsed() already return MB not Bytes. So eventually MoveChunkCommand will be aborted when memory usage is greater than 5TB.
https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/move_chunk_command.cpp#L397
if (shardingState->migrationSourceManager()->mbUsed() > (500 * 1024 * 1024)) {
// This is too much memory for us to use so we're going to abort the migration
...
https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/migration_source_manager.cpp#L557
long long MigrationSourceManager::mbUsed() const
- is related to
-
SERVER-22656 Componentize Migration{Source,Dest}Manager
- Closed