[SERVER-10942] Assign value 11000 to ErrorCodes::DuplicateKey Created: 27/Sep/13  Updated: 11/Jul/16  Resolved: 13/Nov/13

Status: Closed
Project: Core Server
Component/s: Diagnostics, Networking
Affects Version/s: None
Fix Version/s: 2.5.4

Type: Improvement Priority: Major - P3
Reporter: Andy Schwerin Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 13/Nov/13 ]

Author:

{u'username': u'gregstuder', u'name': u'Greg Studer', u'email': u'greg@10gen.com'}

Message: SERVER-10942 use legacy error code for duplicate key
Branch: master
https://github.com/mongodb/mongo/commit/a92a78e2bb9e0444ff256896ec2e86f7edb31c10

Generated at Thu Feb 08 03:24:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.