[CDRIVER-850] Bulk WriteConcern half-ignored Created: 16/Sep/15  Updated: 19/Oct/16  Resolved: 17/Sep/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.2-rc0
Fix Version/s: 1.2-rc0

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


 Description   

The following example will apply a getLastError command piggybacked into the bulk write with writeconcern=0.
Any subsequent command will then result in wire protocol error:

Invalid response_to. Expected 3, got 2.

   write_concern = mongoc_write_concern_new();                                       
   mongoc_write_concern_set_w (write_concern, 1);                                    
   mongoc_client_set_write_concern (client, write_concern);                          
                                                                                     
   str = gen_collection_name ("bulk_write_concern_over_1000");                       
   bulk = mongoc_bulk_operation_new (true);                                          
   mongoc_bulk_operation_set_database (bulk, "test");                                
   mongoc_bulk_operation_set_collection (bulk, str);                                 
   mongoc_write_concern_set_w (write_concern, 0);                                    
   mongoc_bulk_operation_set_write_concern (bulk, write_concern);                    
   mongoc_bulk_operation_set_client (bulk, client);                                  
                                                                                     
   for (i = 0; i < 1010; i+=3) {                                                     
      bson_init(&doc);                                                               
      bson_append_int32(&doc, "_id", -1, i);                                         
                                                                                     
      mongoc_bulk_operation_insert(bulk, &doc);                                      
                                                                                     
      bson_destroy(&doc);                                                            
   }                                                                                 
                                                                                     
   success = mongoc_bulk_operation_execute(bulk, NULL, &error);                                                                           



 Comments   
Comment by Githook User [ 11/Jan/16 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-850: bulk provided write_concern ignored
Branch: 1.3.0-dev
https://github.com/mongodb/mongo-c-driver/commit/8e1491432681946f59388ddb1bf80cbfe1f1d8f8

Comment by Githook User [ 26/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-850: bulk provided write_concern ignored
Branch: debian
https://github.com/mongodb/mongo-c-driver/commit/8e1491432681946f59388ddb1bf80cbfe1f1d8f8

Comment by Githook User [ 17/Sep/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-850: bulk provided write_concern ignored
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/8e1491432681946f59388ddb1bf80cbfe1f1d8f8

Comment by Hannes Magnusson [ 16/Sep/15 ]

https://mongodbcr.appspot.com/25180001/

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