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

Two Phase Drops: dropDatabase does not work with applyOps

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.10
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Repl 2017-07-31

      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}}]})
      

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

              Created:
              Updated:
              Resolved: