Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29541

Two Phase Drops: disallow two-phase drops under master/slave

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.9
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2017-06-19
    • 0

      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
          // Drop unreplicated collections immediately.
          // If 'dropOpTime' is provided, we should proceed to rename the collection.
          auto replCoord = repl::ReplicationCoordinator::get(opCtx);
          auto opObserver = getGlobalServiceContext()->getOpObserver();
          auto isOplogDisabledForNamespace = replCoord->isOplogDisabledFor(opCtx, fullns);
          if (dropOpTime.isNull() && isOplogDisabledForNamespace) {
              auto status = _finishDropCollection(opCtx, fullns, collection);
              if (!status.isOK()) {
                  return status;
              }
              opObserver->onDropCollection(opCtx, fullns, uuid);
              return Status::OK();
          }
      

            Assignee:
            benety.goh@mongodb.com Benety Goh
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: