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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: 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
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:
              Eric Milkie
              Reporter:
              Eric Milkie
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: