[DOCS-13721] Unexpected skip of following batches after duplicate error Created: 20/Jun/20  Updated: 06/Mar/23  Resolved: 06/Mar/23

Status: Closed
Project: Documentation
Component/s: drivers
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Илья Быков Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to NODE-2619 Unordered bulk write aborts on first ... Closed
Participants:
Days since reply: 3 years, 32 weeks, 1 day ago

 Description   

Description

Hello!

 

I just investigated undocumented behavior of unordered bulk execution.

simple example (Node.js):

 

// 1. initialize
const bulk = initializeUnorderedBulkOp();
 
// 2. populating data
bulk.insert(doc1);
bulk.insert(doc2);
bulk.insert(doc3);
...
bulk.insert(doc10000);
 
// 3. execution
bulk.execute().catch(error => {
   // ignore duplicete errors because this decision works faster then find().upsert().update()
   // yes, it's crutch, but it works :)
   if (error.code === 11000) {
     return;
   }
   throw error;
});

So... Sometimes in the bulk object I see more then single batch (If it was large source in input). And if some batch has any document duplicate unique key - following batches won't be processed.

 

Right now i got three batches. First of them has 8547 operations. In bulkResult I find 7 errors (duplicates). So after execution the target collection had increased for 8540 documents. Usually I use 'getWriteErrors()' to collect problems but (surprize), operations from second and next batches didn't have errors because hadn't process. 

 

I tried to use 'continueOnError' flag, but it didn't has any effect.

 

Now I use 4.2.7 version but abut month ago I had upgraded from 3.x. I dont't remember this problem before upgrade, but after quick analyse of result collections I may think that this problem can be present in previous versions... 

 

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Matt Broadstone [ 30/Jun/20 ]

chris.cho this was a bug in the 3.5.x driver, so I don't think adding a special section in the documentation is warranted

 

Comment by Ravind Kumar (Inactive) [ 23/Jun/20 ]

mrshturman@gmail.comIt looks like this issue was fixed in v3.5.8 of the NODE driver. See NODE-2619 for more information. If possible, try upgrading to the Node driver v3.5.9 to confirm that the issue is resolved.

 

 

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