[SERVER-22218] Push opeartion failed if push and upsert for same document were built into same BulkOperation execution Created: 18/Jan/16 Updated: 14/Apr/16 Resolved: 04/Feb/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Concurrency, Performance, Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | gabriel.wang | Assignee: | Wan Bachtiar |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDB 3.0.5 |
||
| Issue Links: |
|
||||
| Operating System: | Linux | ||||
| Steps To Reproduce: | BulkOperationBuilder p_builder p_builder.execute() If both query hit same document, the push operation didn't create the array correctly. If move push operation away from bulkOperationBuilder and run it in the non-bulk mode, the array field was created correctly. |
||||
| Participants: | |||||
| Description |
|
Two separated opeartion: push and upsert were built in same BulkOperation. |
| Comments |
| Comment by Wan Bachtiar [ 04/Feb/16 ] | |
|
Hi Gabriel, We haven’t heard back from you for some time, so I’m going to mark this ticket as resolved. Regards, | |
| Comment by Wan Bachtiar [ 19/Jan/16 ] | |
|
Hi Gabriel, I noticed (from your google groups thread) that you are using WiredTiger storage engine. This behaviour may be caused by Thanks, | |
| Comment by gabriel.wang [ 19/Jan/16 ] | |
|
Hi Wan, Thanks for your prompt response. I thought this issue related to server because the most work of bulk operation happen on server side. As you mentioned about the bulkOpereation mode and the real order of $push and $set operation. BulkOperationBuilder bulk = db_conn_.initializeOrderedBulkOp(db_collection_ns_); According to the calling sequence, the $push is the last one operation on a given document. It's impossible that a $push happen before a $set for a specific document. Moreover, the $set and $push performed on different fields of a document. This issue occurs only when very heavy writing operation on a collection, and about 1/1000 $push operation failed, and most of $push performed correctly. Thanks for your help in advance. | |
| Comment by Wan Bachtiar [ 19/Jan/16 ] | |
|
Hi Gabriel, I have tested the BulkOperationBuilder for mongo-cxx-driver legacy v1.0.1. It behaves as expected. In your case, you may want to specify whether you would like an ordered or unordered bulk operation. You can specify this option with either the initialisation methods or the constructor. See BulkOperationBuilder class reference for more info. Example of using the constructor:
If you are using an unordered bulk operation, and when the $push operation is being executed first before the $set, the $set will overwrite $push. This may appear that the $push operation has not been performed correctly. Note that the latest stable version of mongo-cxx-legacy driver is currently v1.1.0 Also please note that the SERVER project is for reporting bugs or feature suggestions for the MongoDB Server. If you have any follow-up questions on bulk operations ordering, please post on the mongodb-user group Kind regards, Wan. |