[JAVA-656] Don't checkMaster on slaveOk queries Created: 01/Oct/12 Updated: 08/Jan/13 Resolved: 26/Oct/12 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | None |
| Fix Version/s: | 2.9.2, 2.10.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Scott Hernandez (Inactive) | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Disable checkMaster for slaveOk queries. |
| Comments |
| Comment by auto [ 08/Jan/13 ] | |||||||||||||||||||||||||||||||||||||||
|
Author: {u'date': u'2012-10-01T16:31:45Z', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}Message: | |||||||||||||||||||||||||||||||||||||||
| Comment by auto [ 08/Jan/13 ] | |||||||||||||||||||||||||||||||||||||||
|
Author: {u'date': u'2012-10-01T16:31:45Z', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}Message: | |||||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 26/Oct/12 ] | |||||||||||||||||||||||||||||||||||||||
|
Closing this again. Fix for the regression will be done in scope of a new issue: | |||||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 25/Oct/12 ] | |||||||||||||||||||||||||||||||||||||||
|
The fix for this introduced a regression. In the case where you have use the Mongo constructor that takes a list of ServerAddress, or a MongoURI with a list of server addresses, _masterPortPool starts as null. Before this change, the checkMaster call would block until an initial master was found. Now that it no longer does, there is a race between the background thread and application threads. If an application only does non-primary reads, and the list of servers is a list of mongos, until a write is done, then ensureMaster will never be called and you will keep getting this exception:
This test demonstrates the problem.
Output is:
| |||||||||||||||||||||||||||||||||||||||
| Comment by auto [ 02/Oct/12 ] | |||||||||||||||||||||||||||||||||||||||
|
Author: {u'date': u'2012-10-01T09:31:45-07:00', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}Message: | |||||||||||||||||||||||||||||||||||||||
| Comment by auto [ 02/Oct/12 ] | |||||||||||||||||||||||||||||||||||||||
|
Author: {u'date': u'2012-10-01T09:31:45-07:00', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}Message: |