Spurious "readConcern level snapshot is only valid in multi-statement transactions" error

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.0.0-rc5, 4.1.1
    • Affects Version/s: 3.7.9
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • v4.0
    • Repl 2018-05-21, Repl 2018-06-04, Repl 2018-06-18
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The findOne below gets a "readConcern level snapshot is only valid in multi-statement transactions" even though it is in a transaction.

          ses = db.getMongo().startSession()
          dbs = ses.getDatabase("test")
          printjson(dbs.createCollection("c", {writeConcern: {w: "majority"}}))
          printjson(ses.startTransaction())
          printjson(dbs.c.findOne({$where: "sleep(2000)"}))
      

            Assignee:
            Pavithra Vetriselvan
            Reporter:
            Bruce Lucas (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: