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

Two Phase Drops: dropDatabase does not work with applyOps

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.10
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Repl 2017-07-31

      Description

      Since SERVER-29277, the dropDatabase waits for all collection drops to complete before removing the entry for the database from the catalog. To do this, the free function mongo::dropDatabase() needs to call either ReplicationCoordinator::awaitReplicationOfLastOpForClient() or ReplicationCoordinator::awaitReplication(). However, these functions fail when dropDatabase() is called from within an applyOps operation because applyOps executes all its given operations while holding the global lock.

      To reproduce:

      db.adminCommand({applyOps: [{op: 'c', ns: 'test.$cmd', o: {create: 't'}}, {op: 'c', ns: 'test.$cmd', o: {drop: 't'}}, {op: 'c', ns: 'test.$cmd', o: {dropDatabase: 1}}]})
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: