[CDRIVER-431] Allow getting hint for node from failed bulk write operations Created: 25/Sep/14 Updated: 10/Aug/16 Resolved: 23/Feb/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.0.0 |
| Fix Version/s: | 1.4.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jeremy Mikola | 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: |
|
||||||||
| Epic Link: | Public API for PHP drivers | ||||||||
| Description |
|
The PHP prototype is currently using mongoc_bulk_operation_execute() exclusively for write operations. This function returns an integer hint for the node servicing the write on success; however, no hint is returned if an error occurs. That's fine for client-side errors such as empty batches, but I think it'd be helpful to report the hint for server-side errors. I understand we can't change the function signature, but can the hint be made accessible on the reply bson_t without breaking BC? Alternatively, is there another way that I can extract the hint immediately after an unsuccessful call to mongoc_bulk_operation_execute() (perhaps something similar to how mongoc_collection_get_last_error() works)? |
| Comments |
| Comment by Githook User [ 23/Feb/16 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Also document mongoc_bulk_operation_set_hint. |
| Comment by A. Jesse Jiryu Davis [ 17/Aug/15 ] |
|
Let's put the info into the "reply" bson_t where all the other stats like "nInserted" go. |