[CSHARP-202] Should you be able to connect to a replica set when there is no primary? Created: 12/Apr/11 Updated: 02/Apr/15 Resolved: 03/Aug/11 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Feature Request |
| Affects Version/s: | 1.0 |
| Fix Version/s: | 1.2 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently the C# driver will not connect to a replica set when there is no primary. However, it is possible that some applications will wish to connect in read-only mode in such a scenario. Should the driver connect successfully when there is no primary (and only fail when writes are attempted)? Does this require a new connection string option to specify whether a primary is required or not? A similar scenario occurs when a primary exists when first connecting but then steps down subsequently: should the driver allow reads to continue while there is no primary? |
| Comments |
| Comment by Robert Stam [ 03/Aug/11 ] |
|
See waitFor parameter added to Connect method. When driver connects automatically it uses either ConnectWaitFor.Primary or ConnectWatiFor.AnySlaveOk depending on whether it will be doing a write or a read with slaveOk true. |