[GODRIVER-633] commands meant for local node are directed to primary Created: 09/Nov/18 Updated: 11/Sep/19 Resolved: 29/Nov/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Options & Configuration |
| Affects Version/s: | 0.0.17 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | prashant deva | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Go 1.11 |
||
| Issue Links: |
|
||||||||
| Description |
|
We have our custom monitoring agent we run on each mongo instance, which call `serverStatus` like this:
However, it seems the commands are always routed to the primary, since even when run on the secondaries, we get the exact same stats as the primary for metrics like connections, opcounters, opcountersRepl, etc. This seems to be a bug in the driver, where a query being run on 'localhost' is being directed to the primary
|
| Comments |
| Comment by Jeffrey Yemin [ 29/Nov/18 ] |
|
pdeva Thanks for asking about this. We opened |
| Comment by Jeffrey Yemin [ 29/Nov/18 ] |
|
Opened |
| Comment by Ian Whalen (Inactive) [ 26/Nov/18 ] |
|
We will be removing one of the two prior to GA of 1.0. |
| Comment by prashant deva [ 12/Nov/18 ] |
|
does that mean there are plans to replace them with something else in the future? any kind of documentation on this would be good to have |
| Comment by Kristofer Brandow (Inactive) [ 12/Nov/18 ] |
|
pdeva There is no difference. You can use either, they both exist for historical purposes. |
| Comment by prashant deva [ 10/Nov/18 ] |
|
Whats the difference between connect=direct or connect=single? This does not seem to be documented anywhere |
| Comment by Kristofer Brandow (Inactive) [ 09/Nov/18 ] |
|
Hi pdeva, The Go driver will do automatic cluster discovery unless you specify it shouldn't. If you want to connect directly to a secondary and run commands against that secondary you need to add either connect=direct or connect=single to the connection string. --Kris |