[SERVER-11240] Wrong error message when readPreference tags are invalid Created: 17/Oct/13  Updated: 11/Jul/16  Resolved: 13/Nov/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 2.5.4

Type: Bug Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-11117 Tagged Secondary Preffered not workin... Closed
Operating System: ALL
Participants:

 Description   

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".



 Comments   
Comment by Githook User [ 13/Nov/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-11240 Wrong error message when readPreference tags are invalid
Branch: master
https://github.com/mongodb/mongo/commit/ceecafadac2206dc402bcd5fe2a88625d3037202

Generated at Thu Feb 08 03:25:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.