Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3687

Investigate changes in SERVER-94813: Consider changing WriteConcernFailed code name to WriteConcernTimedOut

    • Type: Icon: Investigation Investigation
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator

      Original Downstream Change Summary

      We are changing the name of the error WriteConcernFailed to WriteConcernTimeout to more accurately reflect what it means. Neither the error code nor the error categories are changing.

      Link to WriteConcernFailed: https://github.com/10gen/mongo/blob/842771d8ed692173b3911ca614ffe5dedbeb3d2a/src/mongo/base/error_codes.yml#L111

      From the code perspective, we expect that error codes are checked, not error names / labels. Code that currently checks for WriteConcernFailed rather than error code 64 will fail.

      From the docs perspective, we should no longer reference WriteConcernFailed; it should be replaced with WriteConcernTimeout.

      Description of Linked Ticket

      Almost all of the usages of WriteConcernFailed today are cases where waiting for write concern timed out. It's worth considering changing this code name to better reflect that.

      The only usage we found that isn't for a timeout purpose is on mongos where it is used to combine multiple write concern errors into one. That should maybe have its own error type or we should instead just return one of the errors instead of treating this case specially, in the spirit of this comment, regarding a similar situation where we return MultipleErrorsOccurred when we get multiple write errors.

      I believe drivers should only be checking error codes and labels, not error code names, so I don't think this would present an issue for them.

      See comment for some additional context from Slack discussion.

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: