Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-8365

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

    • Type: Icon: Investigation Investigation
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • Developer Tools

      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:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: