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

Invariant failure when specifying readConcern "majority" and "afterClusterTime" on standalone mongod

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.7
    • Affects Version/s: 3.5.5
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2017-05-08, Sharding 2017-05-29
    • 0

      If we are running a standalone mongod, executing the following commands from a shell will cause an invariant failure:

      use test
      db.test.runCommand({find:"test", readConcern: {level:"majority", afterClusterTime: new Timestamp(0,0)}});
      

      There is an issue with the way read concern options are handled in Command::run in db/commands/dbcommands.cpp. The waitForReadConcern function will try to execute makeNoopWriteIfNeeded if the read concern level is "majority" and there is an "afterClusterTime" field, which will in turn try to run getMyLastAppliedOpTime which will cause this invariant failure if we are not running as a replica set.

      To fix this bug, I think the simplest approach may be to bypass any handling of readConcern options in Command::run if we know that we are not running as a replica set or master/slave node.

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            william.schultz@mongodb.com William Schultz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: