If I pass an array of tag sets that includes null, mongos properly detects that the tag set isn't a BSON object, but raises the wrong error anyway:
mongos> db.sharded_collection.findOne({$query:{shard_key: 500}, $readPreference: {mode: 'secondary', tags:[{'field': 'whatever'}, null]}}) Thu Oct 17 11:21:13.112 JavaScript execution failed: error: { "$err" : "Failed to call say, no good nodes in replset_1", "code" : 16380 } at src/mongo/shell/query.js:L128
In the log:
Thu Oct 17 11:21:13.112 [conn5] User Assertion: 16357:Tags should be a BSON object Thu Oct 17 11:21:13.112 [conn5] can't callLazy replica set slave :27017: :: caused by :: 16357 Tags should be a BSON object Thu Oct 17 11:21:13.112 [conn5] _check : replset_1/localhost:5000,localhost:5001,localhost:5002 Thu Oct 17 11:21:13.112 [conn5] User Assertion: 16380:Failed to call say, no good nodes in replset_1
The user should see the "Tags should be a BSON object" error, not "Failed to call say, no good nodes".
- related to
-
SERVER-11117 Tagged Secondary Preffered not working as expected - Reads always happening at Primary
- Closed