[SERVER-28812] Invariant failure when specifying readConcern "majority" and "afterClusterTime" on standalone mongod Created: 14/Apr/17  Updated: 01/Mar/21  Resolved: 05/May/17

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.5.5
Fix Version/s: 3.5.7

Type: Bug Priority: Major - P3
Reporter: William Schultz (Inactive) Assignee: Misha Tyulenev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-48301 find command should reject $_internal... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2017-05-08, Sharding 2017-05-29
Participants:
Linked BF Score: 0

 Description   

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.



 Comments   
Comment by Githook User [ 05/May/17 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-28812: allow readConcern majority and afterClusterTime on standalone mongod
Branch: master
https://github.com/mongodb/mongo/commit/8a4b235971a59e92e3fa67fd6a92ddcfcd76ce81

Generated at Thu Feb 08 04:19:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.