[CSHARP-201] When connected to a replica set a background thread should monitor the replica set Created: 12/Apr/11 Updated: 02/Apr/15 Resolved: 12/Sep/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 | ||
| Issue Links: |
|
||||||||
| Description |
|
When connected to a replica set a background thread should monitor the replica set by polling isMaster for each member. If a secondary goes offline it should be removed from the list of secondaries. When a secondary comes back online (or a new member is added to the replica set) it should be automatically detected and added to the list of secondaries without having to call MongoServer.Reconnect. Not that in a heavily loaded environment failed secondaries will almost certainly be detected during a regular operation, as they are many times more frequent than the background thread polling. However, the background thread is the only way that returning or newly added secondaries will get added back to the list of secondaries. |
| Comments |
| Comment by Robert Stam [ 23/Dec/11 ] |
|
Note regarding the implementation of See also 1. Detecting when replica set members are added or removed from the set (handling a reconfig without needing to call Reconnect) |
| Comment by Robert Stam [ 12/Sep/11 ] |
|
The TimerCallback in MongoServerInstance now verifies the state of the replica set member every time the timer fires. Any changes in the state of a MongoServerInstance is reflected back to the state of the MongoServer via the InstanceStateChanged event. |