[SERVER-26590] No primary, insert through mongoS hangs for 15 seconds before failing Created: 12/Oct/16 Updated: 20/Dec/16 Resolved: 13/Oct/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 3.2.10 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alessandro Gherardi | Assignee: | Kelsey Schubert |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: |
|
||||||||
| Participants: | |||||||||
| Description |
|
In Mongo 3.2.10, when trying to insert a new document via mongoS and the underlying replicaset has no primary, the write hangs for about 15 seconds before failing with a "could not contact primary for replica set" error. The error is expected. What's not expected is that it takes 15 seconds for mongoS to return that error. In Mongo 3.0.4, the insert fails immediately. |
| Comments |
| Comment by riccardo salzer [ 20/Dec/16 ] |
|
hi kal, |
| Comment by Kaloian Manassiev [ 19/Dec/16 ] |
|
Hi salzamt, Unfortunately in version 3.2 there is no way to lower this wait time - it was added intentionally as a way of "giving a chance" to the shard's replica set to elect a primary or for the network condition to recover itself. In version 3.4 we added support on MongoS for enforcing maxTimeMS. If you specify a value lower than 15 seconds, the server will keep looking for primary for at most this value. Hope this helps. -Kal. |
| Comment by riccardo salzer [ 18/Dec/16 ] |
|
Hi, Imagine following scenario:
actually none really cares if those few requests would raise an exception but everything besides that would at least work. if those are very important, it needs to be handled in the code anyway. |
| Comment by Kelsey Schubert [ 13/Oct/16 ] |
|
Hi alessandro.gherardi@yahoo.com, This is expected behavior and was implemented by Kind regards, |
| Comment by Kelsey Schubert [ 12/Oct/16 ] |
|
Hi alessandro.gherardi@yahoo.com, Thanks for reporting this behavior. We are investigating this issue and will update this ticket when we know more. Kind regards, |