Repro on 1.8.0.
1. Start sharded set
2. Start config DB
3. Start 2 MongoS both pointing at config DB
4. Open 2 windows
4.a. mongoS #1
4.b. mongoS #2
In #2
> use infinity
> db.events_test.stats()
In #1
> use admin
> db.runCommand(
)
> db.runCommand({shardcollection: "infinity.events_test", key: {_id: 1}});
> db.events_test.stats()
In #2
> db.events_test.stats()
===
Bug here
The first thing you'll see here is that #1 & #2 do not match.
#1 will say the collection is sharded
#2 will say the collection is not sharded
===
More fun:
#1
> db.events_test.ensureIndex(
);
> db.events_test.stats()
#2
> db.events_test.stats()
Notice how the indexes were properly communicated?
So we somehow communicated the indexes, but not the sharding status.
I can write to both collections and the data appears.
===
Resolution: bouncing mongoS solves the problem
===