[DRIVERS-237] Include replication lag as a method for server selection Created: 24/Jun/15  Updated: 04/Oct/16  Resolved: 04/Oct/16

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: Mark Unsworth Assignee: Barrie Segal
Resolution: Duplicate Votes: 0
Labels: Driver, Replication, mongos, read-preferences, replicaset
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates DRIVERS-293 Allow users to set a limit on accepta... Closed

 Description   

It would be great to have the option to specify the maximum acceptable replication lag for secondary server selection in the same way that localThresholdMS/secondary_acceptable_latency_ms is provided.



 Comments   
Comment by Jeffrey Yemin [ 04/Oct/16 ]

Closing as a duplicate of DRIVERS-293, in which the maxStalenessMS option was added to the read preference.

Comment by Bernie Hackett [ 24/Jun/15 ]

This couldn't be implemented using current releases of MongoDB, at least not completely. There are at least two problems that would have to be resolved in the server first:

  • The replication lag information would have to be readily available to all authenticated users. Currently this information comes from the replSetGetStatus command, which requires the clusterManager permission to run.
  • mongos would have to accept the acceptable replication lag as a $readPreference option, and apply it when choosing secondaries.

On top of this, drivers monitor connected servers on a fixed frequency (10 seconds), but replication lag tends to spike for short periods of time. That monitoring frequency might not be granular enough. This would not be a solution for trying to force read-your-writes consistency while reading from secondaries.

Generated at Thu Feb 08 08:21:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.