-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
None
-
ALL
Most drivers raise a specific DuplicateKeyError exception for "duplicate key" errors. They do this by checking error returns for specific error codes.
mongos raises error code 16460 for a range of insert errors, including duplicate key error. That error should be handled separately, using a specific code (ErrorCodes::DuplicateKey is appropriate).
The sharding code in question:
https://github.com/mongodb/mongo/blob/master/src/mongo/s/strategy_shard.cpp#L704-L726
- duplicates
-
SERVER-10519 Mongos support for new write operations
- Closed
- is depended on by
-
JAVA-1103 CommandResult.getException not detecting "caused by" duplicate key exception
- Closed
- is related to
-
SERVER-10818 Implement compatibility to older servers
- Closed
- related to
-
PYTHON-592 OperationFailure is raised instead of DuplicateKeyError
- Closed