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

Extend failCommand to return write concern errors

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0-rc2, 4.1.1
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Backport Requested:
      v4.0
    • Sprint:
      Platforms 2018-06-04

      Description

      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)
              }
          }
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              redbeard0531 Mathias Stearn
              Reporter:
              kevin.albertson Kevin Albertson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: