Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
ALL
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');
|
Attachments
Issue Links
- duplicates
-
SERVER-7246 Mongos cannot do slaveOk queries when primary is down
-
- Closed
-
- is duplicated by
-
SERVER-6664 mongos won't create a new connection to a replica set with the primary down
-
- Closed
-
- related to
-
SERVER-7541 mongos should be able to read from secondaries when there is no master
-
- Closed
-