Only drop a maximum of 4 previous checkpoints, during a checkpoint, so the first checkpoint after a hot backup cursor is closed doesn't take a huge amount of time to complete.
There is code in checkpoint that cleans up obsolete checkpoints as soon as they become obsolete. Significant parts of that cleanup happen while holding locks that interrupt other operations (like opening cursors in some cases). When a backup cursor is open for a long period of time a lot of checkpoints are accumulated, and those checkpoints all become eligible for cleanup as soon as the backup cursor is closed.
We should limit the number of checkpoint handles cleaned up with each checkpoint. My recommendation would be cleaning up between 2 and 4 checkpoints per file per checkpoint.
- is related to
SERVER-45696 Lengthy continuous backup can result in lengthy stall on first checkpoint after backup