[JAVA-929] write to replicaset fails after failover Created: 16/Aug/13 Updated: 28/Aug/13 Resolved: 28/Aug/13 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Connection Management |
| Affects Version/s: | 2.11.1, 2.11.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | gomil | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDB V2.0.6 on x86_64 GNU/Linux |
||
| Description |
|
Setup: ReplicaSet with two nodes (node30, node31) I use the java-driver (V2.11.2) with the constructor below (via Spring-Data's MongoFactoryBean)
If the master (node30) goes down, all further write-attempts fail:
I analyzed the driver (class ReplicaSetStatus)
I fixed it locally (used "acceptableMembers" instead of "all" in findMaster() ) and it worked fine for the first failover.
|
| Comments |
| Comment by gomil [ 28/Aug/13 ] |
|
Hello Jeff, thanks for your reply! In my tests I can see that the data is correctly written to the new master, while ConnectionsStatus$UpdatableNode warns (correctly) about the not reachable old master. Sorry for the noise! |
| Comment by Jeffrey Yemin [ 24/Aug/13 ] |
|
I examined the code, and though findMaster does use "all", it calls ReplicaSetNode.master(), which will return false unless _ok is true as well as _isMaster. If the old primary is no longer reachable, then _ok should be false. Are you seeing ReplicaSetNode._ok == true for an unreachable server? |