This comment here is incorrect. Timestamp monitor doesn't take global lock while callbacks are executed. This means we can have concurrent batched catalog writers during HistoricalCatalogIdTracker::cleanup() and can result in below bugs- 1) server crash due to this invariant failure 2) more serious data inconsistency bug - Find command returning incorrect results when the sequence is as follows:
1) HistoricalCatalogIdTracker::cleanup() makes a copy of _nss
2) HistoricalCatalogIdTracker::Create() updates _nss with new catalog id info
3) HistoricalCatalogIdTracker::cleanup updates the persistent copy.