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

Fail point `failCommand` is evaluated twice when `writeConcernError` is specified

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.8
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Sharding 2019-02-11

      Description

      We're using the failCommand fail point for the "Convenient API for Transactions" spec tests to return a write concern error on commitTransaction. The following shell script generally reproduces the issue we're encountering:

      use admin;
      db.runCommand({ configureFailPoint: "failCommand", mode: { times: 2 }, data: { failCommands: ["insert"], closeConnection: false, writeConcernError: { code: 64, codeName: "WriteConcernFailed", errmsg: "waiting for replication did not time out" } } });
      db.test.insert({ a: "something" });
      db.test.insert({ b: "or_other" });
      

      After investigating with Mark Benvenuto, it appears that because closeConnection and writeConcernError are both specified, the fail point is activated twice: first here, then here.

      If closeConnection: false is removed, or {{ mode: { times: 4 } }} is specified, then the fail point operates as expected.

        Attachments

          Activity

            People

            Assignee:
            janna.golden Janna Golden
            Reporter:
            matt.broadstone Matt Broadstone
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: