You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mongos expects read preferences to be strings, not symbols.
This should actually fix RUBY-542. Without this, using read
preferences with a mongos cluster that's backed by replica sets will
error with
wrong type for field (mode) 14 != 2
This is raised by _extraReadPref in dbclient_rs.cpp, when it does:
const string mode = prefDoc["mode"].String();
BSON type 14 (0xE) is the (deprecated) Symbol type, and type 2 is
String, so this indicates that mongos is getting a symbol when it
expects a string.
The sharding tests passed either way because they don't actually
construct replica sets for the shards, and _extractReadPref is only
used by DBClientReplicaSet. Thus, the $readPreference field passed to
mongos is completely ignored by the test mongoS, and not even parsed.
0 commit comments