-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
Query 2019-06-17, Query 2019-07-01
Somewhere between v4.1.7-51-gb4f82034e6 and v4.1.8-73-ge2251dbc97, tests for the convenient transactions API started failing because the server ceased to return a code and code name for DuplicateKey errors.
The response we are currently getting with 4.1.8:
{"n"=>0, "writeErrors"=>[{"index"=>0, "code"=>11000, "keyPattern"=>{"_id"=>1}, "keyValue"=>{""=>1}, "errmsg"=>"E11000 duplicate key error collection: ruby-driver.test index: _id_ dup key: { _id: 1 }"}], "opTime"=>{"ts"=>#<BSON::Timestamp:0x000055dd583c1488 @seconds=1550719073, @increment=3>, "t"=>2}, "electionId"=>BSON::ObjectId('7fffffff0000000000000002'), "ok"=>1.0, "$clusterTime"=>{"clusterTime"=>#<BSON::Timestamp:0x000055dd583c0e70 @seconds=1550719073, @increment=3>, "signature"=>{"hash"=><BSON::Binary:0x47204578231900 type=generic data=0x0000000000000000...>, "keyId"=>0}}, "operationTime"=>#<BSON::Timestamp:0x000055dd583c0bc8 @seconds=1550719073, @increment=3>}
It includes errmsg but no code or code name.
4.0 response for comparison:
{"operationTime"=>#<BSON::Timestamp:0x00005620520854f8 @seconds=1550719590, @increment=3>, "ok"=>0.0, "errmsg"=>"E11000 duplicate key error collection: ruby-driver.test index: _id_ dup key: { : 1 }", "code"=>11000, "codeName"=>"DuplicateKey", "$clusterTime"=>{"clusterTime"=>#<BSON::Timestamp:0x000056205209c680 @seconds=1550719590, @increment=3>, "signature"=>{"hash"=><BSON::Binary:0x47348407684780 type=generic data=0x0000000000000000...>, "keyId"=>0}}}
It looks like previously DuplicateKey was returned as a top level error, and then it had code name and code, and now DuplicateKey is a write error and it does not have code name and code anymore.
- related to
-
RUBY-3107 Add error code_name for all known errors
- Closed