SERVER-68777 we only considered the possibility of having a wrong collection size on the donor and not on the recipient.
Because the actual migration of the documents is not executed atomically with the update of orphanCounter on the recipient side. So, the recipient shard would report a longer collection size than the actual one, if the request is addressed before the update of orphanCounter and after the actual migration of the documents.
NOTE: The recipient clears the 'orphan' tag of the received chunk once the migration commit state is reached.
|7340214 MB (actual: 8388816 MB)
2. At that moment there are no orphans so we don't have to wait for them to be 0.
3. Second balancerCompliant returns too early as well because the recipient has already received the documents but didn't update the orphans counter. So we return wrongly from awaitCollectionBalanced.
|6291612 MB (actual: 5243010 MB)
4. Once the migration ends we finally get the proper size on each shard