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

$clusterTime not included in response with ReadConcernMajorityNotEnabled error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc2
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2017-10-23, Sharding 2017-11-13
    • Case:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: