[CDRIVER-523] mongoc doesn't coalesce updates or deletes, only inserts Created: 05/Feb/15  Updated: 08/Jan/24  Resolved: 18/May/15

Status: Closed
Project: C Driver
Component/s: Bulk API, libmongoc
Affects Version/s: None
Fix Version/s: 1.1.6

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CDRIVER-653 Rearrange unordered bulk ops Closed
Related
related to PHPC-193 Bulk delete and updates result in one... Closed
is related to CDRIVER-255 New write operation method for insert... Closed
Tested
tested by CDRIVER-659 Fuzz-test bulk ops Closed

 Description   

When creating a batch of writes using the bulk interface, only inserts are coalesced, resulting in far many updates and delete roundtrips then expected.

bulk = mongoc_collection_create_bulk_operation()
mongoc_bulk_operation_insert(bulk, document1);
mongoc_bulk_operation_insert(bulk, document2);
mongoc_bulk_operation_insert(bulk, document3);
mongoc_bulk_operation_execute(bulk);

Results in 1 round trip.

bulk = mongoc_collection_create_bulk_operation()
mongoc_bulk_operation_update(bulk, selector1, document1);
mongoc_bulk_operation_update(bulk, selector2, document2);
mongoc_bulk_operation_update(bulk, selector3, document3);
mongoc_bulk_operation_execute(bulk);

Results in 3 round trip.

bulk = mongoc_collection_create_bulk_operation()
mongoc_bulk_operation_delete(bulk, selector1);
mongoc_bulk_operation_delete(bulk, selector2,);
mongoc_bulk_operation_delete(bulk, selector3);
mongoc_bulk_operation_execute(bulk);

Results in 3 round trip.



 Comments   
Comment by Githook User [ 27/May/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-523 post-merge fixups
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/b2f4bcc8f8d26090188b2746d39047efb07671d1

Comment by Githook User [ 18/May/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-523 and CDRIVER-657 - update NEWS
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/71e32fef9d415126b950562c09cd5e2864537cc3

Comment by Githook User [ 18/May/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-523 - leaks in tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d918125715c0e4e67ccad8d833e2dc05553e0aaa

Comment by Githook User [ 18/May/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: new leak in write commands

From the CDRIVER-523 merge, not a prior bug
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5401824a9ed60cccb27467c7c3f2efc454d9b0d3

Comment by Githook User [ 18/May/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-523 improve bulk tests
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/792115ade31aed8bb9c022a428f70632d1faadfe

Comment by Githook User [ 18/May/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-523 double-free in bulk test
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/14c31d4bca4639571d7c8167eaf22bac78d74ed9

Comment by Githook User [ 18/May/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-523 thorough bulk "upserted" index testing
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/89ff56eb69463644678fe8f65c265dfca4b9dcfb

Comment by A. Jesse Jiryu Davis [ 08/May/15 ]

https://github.com/mongodb/mongo-c-driver/pull/227/commits

Comment by A. Jesse Jiryu Davis [ 20/Apr/15 ]

Right, that would be my plan.

Comment by Hannes Magnusson [ 20/Apr/15 ]

Ok. If its OK to include this between the 1.2.0 beta<->final then I'm all good
Thanks!

Comment by A. Jesse Jiryu Davis [ 20/Apr/15 ]

Thanks Hannes! 1.2 beta is due by the end of the month, if getting this correctly merged into 1.2 by then isn't practical, that's ok, it's just a performance enhancement.

Comment by Hannes Magnusson [ 20/Apr/15 ]

I started couple of weeks ago - there are bunch of annoying conflicts for the 1.2 branch that needs careful verification.
I've set aside time for this for our next sprint.

jesse What is the timetable for 1.2.0?

Comment by A. Jesse Jiryu Davis [ 20/Apr/15 ]

bjori would you like to do the merge of your pull requests to master?

Comment by Hannes Magnusson [ 02/Apr/15 ]

jesse Are you able to merge the patches (or alternatively reject them)?

Comment by Hannes Magnusson [ 23/Mar/15 ]

mira.carey@mongodb.com I think this fell between the cracks... afaict the PRs are ready to be pulled?

Comment by Hannes Magnusson [ 05/Feb/15 ]

Turns out there are already outstanding Pull Requests for this.
delete: https://github.com/mongodb/mongo-c-driver/pull/69
update: https://github.com/mongodb/mongo-c-driver/pull/167

Generated at Wed Feb 07 21:09:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.