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

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.1, 3.5.1
    • Affects Version/s: 3.3.8
    • Component/s: Storage
    • None
    • Fully Compatible
    • ALL
    • 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}}]})
    • Storage 2016-12-12
    • 0

      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.

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: