[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:
Related
related to CSHARP-370 Setting a node as Hidden doesn't prop... Closed

 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 CSHARP-201: the new TimerCallback only monitors individual replica set members changing state (going offline, coming back online, changing from primary to secondary, etc...).

See also CSHARP-370, which is related to two additional issues:

1. Detecting when replica set members are added or removed from the set (handling a reconfig without needing to call Reconnect)
2. Handling hidden members a little better

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.

Generated at Wed Feb 07 21:36:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.