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

$clusterTime not included in response with ReadConcernMajorityNotEnabled error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc2
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • ALL
    • Sharding 2017-10-23, Sharding 2017-11-13

      The causal consistency design document states that $clusterTime is included in all responses, even ones reporting an error, as in:

      replset:SECONDARY> db.runCommand({find : "test", readConcern : {level : "local"}  })
      {
      	"operationTime" : Timestamp(1506613470, 1),
      	"ok" : 0,
      	"errmsg" : "not master and slaveOk=false",
      	"code" : 13435,
      	"codeName" : "NotMasterNoSlaveOk",
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1506613470, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	}
      }
      

      At least one error condition violates the rule:

      replset:SECONDARY> db.runCommand({find : "test", readConcern : {level : "majority"}, $readPreference : {mode : "secondary"}  })
      {
      	"ok" : 0,
      	"errmsg" : "Majority read concern requested, but server was not started with --enableMajorityReadConcern.",
      	"code" : 148,
      	"codeName" : "ReadConcernMajorityNotEnabled"
      }
      

      The expected behavior is that the response contains a $clusterTime.

            Assignee:
            misha.tyulenev@mongodb.com Misha Tyulenev (Inactive)
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: