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

Extend failCommand to return write concern errors

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.0.0-rc2, 4.1.1
    • Replication
    • None
    • Fully Compatible
    • v4.0
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: