-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.1.1
-
Component/s: Configuration
There's a bug in com.mongodb.ConnectionString.java in the Java Driver.
// handle legacy slaveok settings if (optionsMap.containsKey("slaveok") && !optionsMap.containsKey("readpreference")) { optionsMap.put("readpreference", asList("secondaryPreferred")); }
This check is assuming that if slaveok is set that it was set to slaveOk=true.
Here's the commit that introduced this bug: https://github.com/mongodb/mongo-java-driver/commit/edb6952fd76ca9eba72b5f018717cb58c0745c0f