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

Assign value 11000 to ErrorCodes::DuplicateKey

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: None
    • Component/s: Diagnostics, Networking
    • Labels:
      None
    • Minor Change

      Clients check one of three codes to identify unique index constraint violations. None are the current value of ErrorCodes::DuplicateKey, which Write commands return in this scenario. Rather than make all drivers check a 4th code, we might as well assign DuplicateKey an existing one, such as 11, 000. Pending validation that the write commands send DuplicateKey.

      Proposal: Rename the existing DuplicateKey to OBSOLETE_DuplicateKey, and assign DuplicateKey <- 11000 in error_codes.err. So long as no existing code looks for the current value of DuplicateKey on the wire, it is safe to change the value used to represent DuplicateKey in error_codes.err. The server code does not, and behackett says the drivers don't, either.

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: