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

Running applyOps with an op on a nonexistent database using mmapv1 will crash mongod

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.3.8
    • Fix Version/s: 3.4.1, 3.5.1
    • Component/s: Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Steps To Reproduce:
      Hide

      Start mongod with mmapv1. Ensure p11 database does not exist.

      db.runCommand({applyOps: [{op:"i", ns: "p11.dbref4", o:{_id:5, x:17}}]})
      

      Show
      Start mongod with mmapv1. Ensure p11 database does not exist. db.runCommand({applyOps: [{op:"i", ns: "p11.dbref4", o:{_id:5, x:17}}]})
    • Sprint:
      Storage 2016-12-12
    • Linked BF Score:
      0

      Description

      See repro steps.

      This crashes because we attempt to construct an OldClientContext while in an active WriteUnitOfWork.
      OldClientContext will attempt to create a database if it doesn't exist.
      Creating a database on mmapv1 will attempt to allocate a new ns file, and then try to flush the journal manually.
      Flushing the journal requires the flush lock, which invariants that we are not in a WriteUnitOfWork.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: