[SERVER-15428] Empty "raw" error from mongos when a shard has no primary or is down Created: 26/Sep/14  Updated: 28/Sep/20  Resolved: 19/Oct/15

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.4.9, 2.6.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to PYTHON-766 KeyError parsing error response from ... Closed
related to DRIVERS-187 Handle empty "raw" errors from mongos Closed
is related to PYTHON-2381 Remove handling of "raw" field in com... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Start a sharded cluster of two-member replica sets and kill a primary, so one of the shards has only a secondary. Run 'dbstats' on a database, mongos responds:

{
	"raw" : {
		"shard0/localhost:4000,localhost:4001" : {
 
		}
	},
	"ok" : 0,
	"errmsg" : "{ shard0/localhost:4000,localhost:4001: \"result without error message returned : {}\" }"
}

This seems like an unclear error message, and the "raw" error document is empty, which is unlike most other error structures from mongos.

Tested with 2.4.9 and 2.6.4. Same behavior if all members of the shard are down, not just the primary.

Drivers may need to be updated now if they don't expect an empty error document in "raw" (see PYTHON-766, PyMongo throws an exception trying to parse this error), and they may need validation that they can parse the corrected error message if mongos is updated to return a different error in this scenario.



 Comments   
Comment by Ian Whalen (Inactive) [ 26/Apr/19 ]

Switching "Drivers Changes Needed" from "Maybe" to "Not Needed" since this was closed as something other than Fixed.

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