[JAVA-225] Read against dead replica slave doesn't fail over correctly when there is no master Created: 02/Dec/10 Updated: 22/Dec/10 Resolved: 07/Dec/10 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Cluster Management |
| Affects Version/s: | 2.3 |
| Fix Version/s: | 2.4 |
| Type: | Bug | Priority: | Blocker - P1 |
| Reporter: | Daniel Rinehart | Assignee: | Antoine Girbal |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
We always want reads against Mongo to succeed if there is at least one standard or passive node of the replica set alive. However, in DBTCPConnector's call() handling, if an IOException occurs against the chosen DBPort, the logic in _error() that calls checkMaster() will cause an error if the master is also unavailable. This checkMaster() needs to be conditional based on slaveOk being set. That is, if slaveOk is true in the call() method the check should be checkMaster(true, false) so that the list of hosts is refreshed even if it results in no master being found. |
| Comments |
| Comment by Antoine Girbal [ 07/Dec/10 ] |
|
thanks for the report, this is a problematic bug. |
| Comment by auto [ 07/Dec/10 ] |
|
Author: {'login': 'agirbal', 'name': 'agirbal', 'email': 'antoine@10gen.com'}Message: |
| Comment by Chris Tierney [ 03/Dec/10 ] |
|
There is an additional problem with call(); even before it attempts to connect it calls checkMaster( false , true ), which could also result in an error if there is no master available. |