With 2-phase drops, collections are not physically dropped (on all nodes) until the commit point advances past the optime when the collection drop was first requested on the primary. Since the ReplicationCoordinator maintains the commit point, it is a logical choice for a location to hold this list of drop-pending collections.
This list is updated when:
- At server startup, we scan all non-local databases for collections with a drop-pending namespace (see
- When processing a collection drop command in a replicated setting, we add the drop-pending namespace after renaming the collection and logging the drop request in the oplog.