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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 3.5.9
    • None
    • Replication
    • None
    • Fully Compatible
    • ALL
    • Repl 2017-06-19
    • 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
          }
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: