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

Extend failCommand to return write concern errors

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.0-rc2, 4.1.1
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • v4.0
    • Platforms 2018-06-04

      Retryable writes now retries upon receiving a write concern error. It'd be nice to add tests to check this in our spec tests.

      Currently (per SERVER-34551) we can specify arbitrary error codes like the following shows:

      > db.adminCommand({"configureFailPoint":  "failCommand", mode: {times:1}, data:{errorCode:11601, closeConnection:false}});
      > db.runCommand('serverStatus')
      db.runCommand('serverStatus');
      {
      	"operationTime" : Timestamp(1525994518, 1),
      	"ok" : 0,
      	"errmsg" : "Failing command due to 'failCommand' failpoint",
      	"code" : 11601,
      	"codeName" : "Interrupted",
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1525994518, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	}
      }
      

      Can we extend the failCommand failpoint to return write concern errors? Something like the following:

      > db.adminCommand({configureFailPoint:  "failCommand", mode: {times:1}, data:{errorReply: {ok: 1, writeConcernError: {code:91}}, closeConnection:false}});
      > db.runCommand('serverStatus')
      {
          "operationTime" : Timestamp(1525994518, 1),
          "ok" : 1,
          "writeConcernError": { "code": 91,  "codeName": "ShutdownInProgress" }
          "$clusterTime" : {
              "clusterTime" : Timestamp(1525994518, 1),
              "signature" : {
                  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                  "keyId" : NumberLong(0)
              }
          }
      }
      

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: