I was recently experimenting with MongoDB, and specifically with the MongoDB migration protocol.
I tried to find the “_migrateClone” command in order to see how I can append my own command.
So with grep I found:
Method createMigrateCloneRequest on MigrationDestinationManager class creates the _migrateClone Command and sends it to the source shard.
I found the command inside the source code migration_chunk_cloner_source_legacy_commands.cpp line 131.
So my guess is whenever _migrateClone command is received, run() method is being executed.
I was searching the source code using grep “migration_chunk_cloner_source_legacy_commands.cpp”. My thought was that this class must be somewhere included in order to execute the run method. However I did not found any point that this file is somewhere included