We tested an upgrade from mongo-ruby-driver 2.11.0 to 2.14.0 and had to roll it back because it caused queries with secondary preferred read preference to be routed to primaries by mongoses and overloaded our primary mongoD servers. We have a sharded mongoS environment running MongoDB 4.0.12 with WiredTiger.
We make heavy use of read(:mode => {:secondary_preferred}) in our code. It seems that with https://github.com/mongodb/mongo-ruby-driver/pull/1932 to fit the spec $readPreference is only sent when a non-mode field is present. This had a result of no longer sending "$readPreference"=>{"mode"=>"secondaryPreferred"}" down with our queries. We set verbose logging to true on our secondaries and found that all secondary queries stopped.
I can update our code to put maxStalenessSeconds everywhere but this seems like it is a change that should have had a major version bump? What do you recommend for how to fix this?