[CXX-1284] aggregate on secondary fails plus max_staleness assertion heisenbug Created: 23/Mar/17 Updated: 11/Sep/19 Resolved: 03/Apr/17 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Implementation |
| Affects Version/s: | 3.1.1 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Denis Bip | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux/debian 8.6 |
||
| Issue Links: |
|
||||||||||||
| Description |
|
Hi! I'm trying to read from a secondary of replicaSet and get "Not master and slaveOk=false". Can you help me? |
| Comments |
| Comment by David Golden [ 03/Apr/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I'm going to close this ticket, as I can't reproduce the max_time_ms bug in over 400,000 iterations. It's possible the bug fixes for read preferences to secondaries fixed some uninitialized memory bug that was causing the assertion failure. Thanks for the initial report and your patience and the aggregation to secondaries fixes will be in our 3.2.0-rc0 targeted around the end of April. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Denis Bip [ 24/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi, if still actual - I've checked all servers version, its 3.4.2, maxWireVersion is 5. Thank you for help, I'll wait for a new version of drivers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Golden [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The "aggregate from secondary" problem is a bug in libmongoc and has been filed as It works in mongocxx with an explicit read preference option due to a side effect of a bug, which has been filed as The max_staleness assertion is currently a stumper, so I'm going to leave this question open but retitle it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Golden [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi, again. I can see where (with assertions off), the same bug that triggered my assertion could also put you in the code path that could report "Not all servers support maxStalenessSeconds", but only if one member of your topology is not running MongoDB 3.4. Could you please confirm the versions of everything in your production deployment? (e.g. get your replica set status output and for each node, run 'ismaster' – the maxWireVersion field should be '5' for all of them.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Golden [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Does the other one look anything like this?
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Golden [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I can replicate the "Not master" error and am trying to determine if it's a bug in mongocxx or upstream in libmongoc. If you want to video the other problem, please feel free, but I'm not sure there's much we can do unless we have a way to replicate it. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Denis Bip [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I can make video or screenshots if it may help to understand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Denis Bip [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
libmongoc is 1.5.3. Yes all servers are the same version. It is just a replica set, not sharded. Something strange is going on tests...If I include some other undepended of mongo files (logs for example) code throw an error again, like in real project...so only primary read works | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Golden [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
What version of libmongoc are you using? For the main project, all your servers are the same version? Is it just a replica set or is it sharded? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Denis Bip [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I wrote special test, so, fisrt way does not work (error "Not master and slaveOk=false"), second way (option pass) start to work, but only in test project, main project continue throw an error "Not all servers support maxStalenessSeconds".
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Golden [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Could you please provide a complete, minimal example, per SSCCE? Ideally it should be something I can download, compile and run to see the error. Please include the connection string you use, though replace any host names with "foo.example.com" or similar, and I'll fix that before I compile. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Denis Bip [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
part code looks like (for second way):
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Denis Bip [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Two ways I've tried to do: Both errors fires in try/catch block when trying to fetch after call aggregate method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by David Golden [ 23/Mar/17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sure, we can help. Could you please put together an SSCCE? I.e. assume I have a replica set running, how exactly do I see what you're seeing? |