We frequently call checkForInterrupt() so that index builds can be quickly aborted. We do this on each iteration of collection scanning and bulk-loading sorted keys into the index.
If an index build is aborted between these two phases, this invariant will fail because the MultiIndexBlock has already been cleaned up by a different thead.
This scenario is normally protected by Collection X lock held by the operation aborting the index build, but the index builder will yield/restore while scanning.
I think this invariant can fail if an index build is aborted while it is yielding, and after it restores it hits the end of the collection and does not call checkForInterrupt(). We need to call checkForInterrupt() in dumpInsertsFromBulk before checking the _buildIsCleanedUp invariant.