|
The current two-phase drop logic in DatabaseImpl::dropCollectionEvenIfSystem() applies to both replica sets and master/slave. This is unnecessary because 2 phase drops are designed to support rollback, which is not applicable to master/slave.
https://github.com/mongodb/mongo/blob/783d11c4ea92784dc6ca0cc0419403c454c9ec9c/src/mongo/db/catalog/database_impl.cpp#L455
|
database_impl.cpp
|
450
|
// Drop unreplicated collections immediately.
|
451
|
// If 'dropOpTime' is provided, we should proceed to rename the collection.
|
452
|
auto replCoord = repl::ReplicationCoordinator::get(opCtx);
|
453
|
auto opObserver = getGlobalServiceContext()->getOpObserver();
|
454
|
auto isOplogDisabledForNamespace = replCoord->isOplogDisabledFor(opCtx, fullns);
|
455
|
if (dropOpTime.isNull() && isOplogDisabledForNamespace) {
|
456
|
auto status = _finishDropCollection(opCtx, fullns, collection);
|
457
|
if (!status.isOK()) {
|
458
|
return status;
|
459
|
}
|
460
|
opObserver->onDropCollection(opCtx, fullns, uuid);
|
461
|
return Status::OK();
|
462
|
}
|
|