[SERVER-7967] In sharded clusters on failed insert GLE sometimes returns null err field Created: 17/Dec/12  Updated: 15/Feb/13  Resolved: 18/Dec/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.2.2, 2.3.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Asya Kamsky Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File dupBadNoErr.js    
Issue Links:
Duplicate
duplicates SERVER-7958 GLE on sharded cluster can return pre... Closed
Related
related to SERVER-8097 Inserts don't increment writebacksSince Closed
Operating System: ALL
Steps To Reproduce:

see attached

Participants:

 Description   

When doing an insert into a sharded collection because of SERVER-4381 but in attached testcase it does not properly set "err:" field and "code:" field when writeback listeners are involved.

Before fix for SERVER-4532 and SERVER-7958 the attached code would set err: but not code: fields (so it would fail in the first failed asserts before split/migration) however testing it with both of those fixes now it returns proper GLE before split/migrate but after returns:

assert failed : Insert of a duplicate record after split/migrate did not create correct GLE{
"singleShard" : "localhost:30000",
"n" : 0,
"connectionId" : 21,
"err" : null,
"ok" : 1,
"code" : 11000,
"writebackGLE" :

{ "singleShard" : "localhost:30000", "n" : 0, "connectionId" : 21, "err" : null, "ok" : 1 }

,
"initialGLEHost" : "localhost:30000",
"initialGLE" : {
"err" : "E11000 duplicate key error index: test.trans.$owner_1 dup key: { : 1234567890 }",
"code" : 11000,
"n" : 0,
"connectionId" : 16,
"ok" : 1
}
}



 Comments   
Comment by Asya Kamsky [ 18/Dec/12 ]

Duplicate of SERVER-7958

Comment by Asya Kamsky [ 18/Dec/12 ]

Okay, while this might be considered a special case of SERVER-7958 there was an additional set of changes that were needed to make this test pass.

However, since without those changes SERVER-7948 doesn't completely pass, I'm going to merge them by making this a duplicate, adding fixes from this one to that ticket and adding all the tests in one place.

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