-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.1
-
Component/s: Sharding
-
ALL
-
-
(copied to CRM)
db.getCollectionNames() on mongos essentially reflects db.getCollectionNames() output from the mongod of the database's primary shard. If small, one-chunk collections are created prior to a movePrimary, db.getCollectionNames() query the newly changed primary shard which doesn't report the existence of those small, one-chunk collections.
mongos> sh.status() --- Sharding Status --- sharding version: { "_id" : 1, "version" : 3 } shards: { "_id" : "s1", "host" : "s1/localhost:10000,localhost:10001,localhost:10002", "tags" : [ "a" ] } { "_id" : "s2", "host" : "s2/localhost:20000,localhost:20001,localhost:20002", "tags" : [ "b" ] } databases: { "_id" : "admin", "partitioned" : false, "primary" : "config" } { "_id" : "test", "partitioned" : true, "primary" : "s2" } mongos> db.counter.insert({a:1}) mongos> db.counter.ensureIndex({a:1}) mongos> sh.shardCollection("test.counter",{a:1}) { "collectionsharded" : "test.counter", "ok" : 1 } mongos> sh.status() --- Sharding Status --- sharding version: { "_id" : 1, "version" : 3 } shards: { "_id" : "s1", "host" : "s1/localhost:10000,localhost:10001,localhost:10002", "tags" : [ "a" ] } { "_id" : "s2", "host" : "s2/localhost:20000,localhost:20001,localhost:20002", "tags" : [ "b" ] } databases: { "_id" : "admin", "partitioned" : false, "primary" : "config" } { "_id" : "test", "partitioned" : true, "primary" : "s2" } test.counter chunks: s2 1 { "a" : { $minKey : 1 } } -->> { "a" : { $maxKey : 1 } } on : s2 Timestamp(1000, 0) mongos> db.getCollectionNames() [ "counter", "system.indexes" ] mongos> db.adminCommand({movePrimary:"test",to:"s1"}) { "primary " : "s1:s1/localhost:10000,localhost:10001,localhost:10002", "ok" : 1 } mongos> db.getCollectionNames() [ "system.indexes" ] mongos> db.adminCommand({movePrimary:"test",to:"s2"}) { "primary " : "s2:s2/localhost:20000,localhost:20001,localhost:20002", "ok" : 1 } mongos> db.getCollectionNames() [ "counter", "system.indexes" ]
- duplicates
-
SERVER-32643 ensure 'clone' command can be used to copy catalog info (indexes, options, and views) for *all* collections in the db
- Closed
- is duplicated by
-
SERVER-8870 mongos unaware of database move after movePrimary
- Closed
-
SERVER-12688 After a shard is removed, db.collection.stats() still shows the removed shard
- Closed
- is related to
-
SERVER-11509 movePrimary should error when database is not drained
- Closed
-
SERVER-22905 mongos are having different data in shared cluster
- Closed