[GODRIVER-347] Write errors are not handled for command responses Created: 05/Apr/18 Updated: 27/Oct/23 Resolved: 23/Apr/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Administrative Commands |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Thomas Delacour (Inactive) | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
An example insert command that results in a duplicate key write error:
I'm not sure why the ok field is set to 1 here. I have noticed this before, and I think this has caused issues with mgo in the past, specifically with duplicate key errors. Maybe this is a mongod bug? But the driver is also not checking for the writeErrors field. The relevant file is mongo/private/conn/protocl.go. |
| Comments |
| Comment by Githook User [ 27/Apr/18 ] |
|
Author: {'email': 'kris@mongodb.com', 'username': 'skriptble', 'name': 'Kris Brandow'}Message: Ensure write operation error are returned
Change-Id: Ib3321215285029b9602f27ca4a89d588ef643238 |
| Comment by Jeffrey Yemin [ 23/Apr/18 ] |
|
No problem. It's always been a source of confusion that write errors are still ok : 1 |
| Comment by Thomas Delacour (Inactive) [ 23/Apr/18 ] |
|
jeff.yemin oh huh. There's no specific use case, but during development I noticed that I wasn't getting any errors back when inserting multiple test documents with the same _id. Certainly not specifically an issue for us; thanks for the clarification on where this would be seen as exceptional! |
| Comment by Jeffrey Yemin [ 23/Apr/18 ] |
|
No other drivers do this (writeErrors are only seen as exceptional in the write command helper methods, e.g. insertOne, insertMany). thomas.delacour what's the use case? |
| Comment by Thomas Delacour (Inactive) [ 05/Apr/18 ] |
|
Ok cool, thanks! |
| Comment by Kristofer Brandow (Inactive) [ 05/Apr/18 ] |
|
This is a known issue and return "ok": 1. We just aren't returning write errors or write concern errors yet. This will be handled once |