[SERVER-21552] Ismaster on mongos fails if no shard exists Created: 19/Nov/15  Updated: 19/Nov/15  Resolved: 19/Nov/15

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

Type: Bug Priority: Major - P3
Reporter: Christian Amor Kvalheim Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

1. bring up 1 shard
2. bring up 1 config server.
3. connect mongos to config server and issue ismaster command

Participants:

 Description   

When calling ismaster on the mongos proxy the command will fail if there is no shard with the following error. This is confirmed to happen on 3.0.x and earlier but not on 3.2.x.

mongos> db.runCommand({ismaster:true})
2015-11-19T14:32:20.397+0100 E QUERY    Error: error: {
	"$err" : "error creating initial database config information :: caused by :: can't find a shard to put new db on",
	"code" : 10185
}
    at Error (<anonymous>)
    at DBQuery.next (src/mongo/shell/query.js:259:15)
    at DBCollection.findOne (src/mongo/shell/collection.js:189:22)
    at DB.runCommand (src/mongo/shell/db.js:58:41)
    at (shell):1:4 at src/mongo/shell/query.js:259



 Comments   
Comment by Andy Schwerin [ 19/Nov/15 ]

I'm assuming, of course, that ismaster against the admin database is working. Otherwise, the shell and drivers would never be able to set up new sharded clusters.

Comment by Andy Schwerin [ 19/Nov/15 ]

The improved behavior in 3.2 is the result of work we did during the refactor to enable config server replica sets. Since the workaround of running ismaster against the admin database is easy, I think we'll leave the old behavior alone on 3.0 and before.

Comment by Christian Amor Kvalheim [ 19/Nov/15 ]

I take it back. Ismaster is in fact causing an issue.

Execute ismaster against system.$cmd and it fails with the above message if there are no shards. Works perfectly on 3.2

Comment by Christian Amor Kvalheim [ 19/Nov/15 ]

Actually never mind there seems to be a bug in the driver. you can close this ticket.

Comment by Christian Amor Kvalheim [ 19/Nov/15 ]

system.$cmd

Comment by Andy Schwerin [ 19/Nov/15 ]

What's the database? Admin?

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