[SERVER-29541] Two Phase Drops: disallow two-phase drops under master/slave Created: 09/Jun/17  Updated: 30/Oct/23  Resolved: 13/Jun/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 3.5.9

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2017-06-19
Participants:
Linked BF Score: 0

 Description   

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
    }



 Comments   
Comment by Githook User [ 13/Jun/17 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-29541 disallow drop-pending collections under master/slave
Branch: master
https://github.com/mongodb/mongo/commit/e262c56e47d7f5c88e9f08833545c3cc35ad4769

Generated at Thu Feb 08 04:21:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.