In current MongoDB code, the critical section will be entered regardless of whether the session migration has completed. This makes sense from a correctness standpoint – we must block writes before ensuring that all sessions associated with those writes have been migrated over. However, there exists the question of whether it's possible to coordinate the choice to enter the critical section with specific checkpoints in the critical section. Without such checkpointing, a migration could still take a long time completing the session migration while blocking writes.
An example would be ensuring that all entries that originally existed in the on-disk session catalog when migration started have been copied over before entering the critical section.
The cost of waiting on session migration checkpointing before entering the critical section is that it would allow more writes to come in, causing transferMods to take longer as well.
This ticket is to investigate the possibility of a middle ground with checkpointing session migrations while not prolonging the length of the migration unnecessarily. Other solutions to this problem are also welcome.