[SERVER-2478] can't start usable mongos if replSet shard lacks a master Created: 04/Feb/11  Updated: 10/Dec/14  Resolved: 27/Aug/13

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Randolph Tan
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-7246 Mongos cannot do slaveOk queries when... Closed
is duplicated by SERVER-6664 mongos won't create a new connection ... Closed
Related
related to SERVER-7541 mongos should be able to read from se... Closed
Operating System: ALL
Participants:

 Description   

queries with slaveOk fail with error:

{ "$err" : "socket exception", "code" : 11002 }

Once enough members are up to have a master, all requests succeed, even if you bring the replSet down to a single working member. I think this is related to the WriteBack command but am not sure yet.

var st = new ShardingTest({ shards: { rs0: { nodes: 2, oplogSize: 2 }}, mongos : 0, });
var replTest = st.rs0;
replTest.awaitSecondaryNodes();
printjson(replTest.status());
 
print("Starting a mongos while replSet is intact")
var ports = allocatePorts(2);
var s1 = startMongos( { port : ports[0], v : 0, configdb : st._configDB } );
 
print("query the config db with readPref secondary");
assert.eq(s1.getDB("config").settings.find().readPref("secondary").count(), 1); 
 
print("Stopping the primary");
replTest.stopMaster();
sleep(3);
printjson(replTest.status());
 
print("Starting a mongos with no primary in shard");
var s2 = startMongos( { port : ports[1], v : 0, configdb : st._configDB } );
print("Query the config db with readPref secondary");
assert.eq(s2.getDB("config").settings.find().readPref("secondary").count(), 1, 'failed to query the config db');



 Comments   
Comment by Ian Whalen (Inactive) [ 28/Nov/12 ]

provide a test case.

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