-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.9.2
-
Component/s: Configuration
-
None
-
Minor Change
When the ReadPreferenceMode is Primary it is not valid to supply tag sets, but the driver currently doesn't enforce that. There are multiple ways that such an invalid read preference might come to exist.
One example is:
var tagSets = new [] { new ReplicaSetTagSet { new ReplicaSetTag("dc", "ny") } }; var readPreference = new ReadPreference(ReadPreferenceMode.Primary, tagSets);
Another example is:
var builder = new MongoUrlBuilder("mongodb://localhost/?readPreference=primary;readpreferencetags=dc:ny"); var url = builder.ToMongoUrl();
There might be other ways.