[CDRIVER-586] Bulk Writes sent to wrong server in write command mode Created: 20/Mar/15 Updated: 08/Jan/24 Resolved: 24/Mar/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.1.2 |
| Fix Version/s: | 1.2-beta0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hannes Magnusson | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The bulk->hint is used to do all the precondition checks, including wire version, to decide if we should do legacy op inserts or write commands. When legacy op inserts are detect we submit the write to the correct bulk->hint server. However, in the case of write commands this hint gets lost mid-way and a new server selected. This has two consequences:
|
| Comments |
| Comment by Githook User [ 07/Oct/15 ] | ||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'hanumantmk', u'name': u'Jason Carey (hanumantmk)', u'email': u'jcarey@argv.me'}Message: Bulk writes could have a hint set, which was used for decisions around Added support for a command_simple_with_hint, which allows for a hint. | ||||||||||||||||||||||||||||||||||||||||
| 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: Merge branch 'pr-233' into 1.2.0-dev
| ||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 27/May/15 ] | ||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}Message: This fixes issues (again) where we preselect a node and do all our checks based It also fixes intentionaly secondary-writes (e.g. to the local db) | ||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 24/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'hanumantmk', u'name': u'Jason Carey (hanumantmk)', u'email': u'jcarey@argv.me'}Message: Bulk writes could have a hint set, which was used for decisions around Added support for a command_simple_with_hint, which allows for a hint. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 23/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||
|
Works! thanks mira.carey@mongodb.com | ||||||||||||||||||||||||||||||||||||||||
| Comment by Mira Carey [ 23/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||
|
I pulled together a fix in: https://github.com/mongodb/mongo-c-driver/pull/208 Basically, it adds a private command_simple_with_hint, which we use for write commands to route to a specific node. Tell me if that fixes your problem | ||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 20/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||
|
Just realized I was running with uncommitted patch that fixes the batch->hint actually being used - see https://github.com/mongodb/mongo-c-driver/pull/207 The issue of the hint being discarded before executing the cursor is still an issue though, likely reproducable with normal commands. | ||||||||||||||||||||||||||||||||||||||||
| Comment by Hannes Magnusson [ 20/Mar/15 ] | ||||||||||||||||||||||||||||||||||||||||
As you can see in the backtrace, the provided hint is dropped by the mongoc_client_command_simple() call. |