[JAVA-169] Inserts fails during a replica set failover Created: 28/Sep/10 Updated: 09/Jan/14 Resolved: 23/Feb/11 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Cluster Management |
| Affects Version/s: | 2.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alvin Richards (Inactive) | Assignee: | Antoine Girbal |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
db version v1.7.1-pre-, pdfile version 4.5 |
||
| Issue Links: |
|
||||
| Description |
|
Problem: MongoOptions mo = new MongoOptions(); String addresses = args[0]; while (addresses.contains(",")) { String next[] = addresses.split(","); connectionList.add(createAddress(next[0])); addresses = next[1]; }connectionList.add(createAddress(addresses)); Mongo mongo = new Mongo( connectionList , mo ); When I cause the current primary to step down (rs.stepDown()), the Java driver throws the following Exception in thread "Thread-1" com.mongodb.MongoException: not talking to master and retries used up Not sure if there is something else that can be set in order to continue the insert process during the take over event. Workaround: Business Case: |
| Comments |
| Comment by Antoine Girbal [ 23/Feb/11 ] |
|
as per previous explanation, this works as expected. |
| Comment by Antoine Girbal [ 17/Feb/11 ] |
|
Tony: If slaveOk=false, then any read happening will try to go to master and fail, but then automatically retry after updating master. It would be too expensive to check if a server is still master before every writes.
Alvin: |
| Comment by Tony Nelson [ 11/Feb/11 ] |
|
I was seeing a similar problem with Mongo server 1.6.5 and Java client library 2.4. The full email log can be seen here: http://groups.google.com/group/mongodb-user/browse_thread/thread/42a12735b26e5be3 In a nutshell, connecting to a 3 node replica set with slaveOk() set caused this issue: Caused by: com.mongodb.MongoException: not master On any write after I manually made the master step down. Commenting out slaveOk() worked around the problem. |
| Comment by Jeff Yemin (Inactive) [ 05/Oct/10 ] |
|
I'm getting that exception using github trunk, by the way (while testing slaveOk()), and it didn't recover. |
| Comment by Eliot Horowitz (Inactive) [ 05/Oct/10 ] |
|
the find case should be fixed in 2.2 |
| Comment by Jeff Yemin (Inactive) [ 05/Oct/10 ] |
|
Also happening on find: com.mongodb.MongoException: not talking to master and retries used up Nothing to do but restart Java process? |