[SERVER-20395] ClusterFind::runQuery cant not detect if a collection became unsharded Created: 14/Sep/15  Updated: 12/Feb/16  Resolved: 17/Sep/15

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

Type: Bug Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Misha Tyulenev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Set readMode=commands and resmoke jstests/sharding/zero_shard_version.js

another way to reproduce is to run in mongo shell

var st = new ShardingTest({ shards: 2, mongos: 4 });
st.stopBalancer();
 
var testDB_s0 = st.s.getDB('test');
testDB_s0.adminCommand({ enableSharding: 'test' });
testDB_s0.adminCommand({ movePrimary: 'test', to: 'shard0001' });
testDB_s0.adminCommand({ shardCollection: 'test.user', key: { x: 1 }});
 
var testDB_s1 = st.s1.getDB('test');
testDB_s1.user.insert({ x: 1 });
testDB_s1.adminCommand({ moveChunk: 'test.user', find: { x: 0 }, to: 'shard0000' });
 
testDB_s0.user.findOne({ x: 1 });
 
 
testDB_s1.user.drop();
testDB_s1.user.insert({ x: 10 });
 
testDB_s0.user.findOne({ x: 10 });

The last statement will produce an assert

Participants:

 Description   

ClusterFind::runQuery cant not detect if a collection became unsharded and throws a 10181 assert



 Comments   
Comment by Githook User [ 17/Sep/15 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-20395 ClusterFind::runQuery should read from primary if a collection became unsharded
Branch: master
https://github.com/mongodb/mongo/commit/0362fb5ddb53c02a3f0c22eda062437513ecfca7

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