From visual inspection of the chunk migration code, there are at least 3 places where nodes can unnecessarily sleep for up to a second:
- On the donor, during awaitUntilCriticalSectionIsAppropriate, if the clone phase takes more than 500 msec, we would waste half a second on average in idle time before the donor can enter the critical section.
- On the recipient, during the catchup phase
- On the recipient, during the final majority commit
These sleeps unnecessarily increase the length of the balancer round, pollute the logs and on top of that could actually cause more mods to accumulate on the donor, potentially increasing the duration of the critical section catch-up phase.
Most likely they are artifacts of MMAP V1 where chunk migration was intentionally slowed down in order not to interfere with live workload, but no longer make sense for WT. If we remove them we should still preserve some comparable throttle for MMAP V1.