-
Type: Improvement
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
-
0.25
When performing sh.addTagRange(ns, min, max, tag), the chunk is split at min (if not already split there).
This should be made explicit so that users know the full effect of their addTagRange command.
Here is the addTagRange doc:
http://docs.mongodb.org/manual/reference/method/sh.addTagRange/
Steps to Reproduce:
mongos> sh.enableSharding("testDB") { "ok" : 1 } mongos> sh.shardCollection("testDB.testColl", { a : 1 } ) { "collectionsharded" : "testDB.testColl", "ok" : 1 } mongos> sh.status() --- Sharding Status --- sharding version: { "_id" : 1, "version" : 4, "minCompatibleVersion" : 4, "currentVersion" : 5, "clusterId" : ObjectId("53f67f7cd68704c62f3f8b31") } shards: { "_id" : "shard01", "host" : "shard01/will-macbook-air.local:27018,will-macbook-air.local:27019,will-macbook-air.local:27020" } { "_id" : "shard02", "host" : "shard02/will-macbook-air.local:27021,will-macbook-air.local:27022,will-macbook-air.local:27023" } { "_id" : "shard03", "host" : "shard03/will-macbook-air.local:27024,will-macbook-air.local:27025,will-macbook-air.local:27026" } databases: { "_id" : "admin", "partitioned" : false, "primary" : "config" } { "_id" : "testDB", "partitioned" : true, "primary" : "shard01" } testDB.testColl shard key: { "a" : 1 } chunks: shard01 1 { "a" : { "$minKey" : 1 } } -->> { "a" : { "$maxKey" : 1 } } on : shard01 Timestamp(1, 0) { "_id" : "grades", "partitioned" : false, "primary" : "shard02" } mongos> sh.addTagRange("testDB.testColl", { a : 3 }, { a : 5 }, "asdf" ) mongos> sh.status() --- Sharding Status --- sharding version: { "_id" : 1, "version" : 4, "minCompatibleVersion" : 4, "currentVersion" : 5, "clusterId" : ObjectId("53f67f7cd68704c62f3f8b31") } shards: { "_id" : "shard01", "host" : "shard01/will-macbook-air.local:27018,will-macbook-air.local:27019,will-macbook-air.local:27020" } { "_id" : "shard02", "host" : "shard02/will-macbook-air.local:27021,will-macbook-air.local:27022,will-macbook-air.local:27023" } { "_id" : "shard03", "host" : "shard03/will-macbook-air.local:27024,will-macbook-air.local:27025,will-macbook-air.local:27026" } databases: { "_id" : "admin", "partitioned" : false, "primary" : "config" } { "_id" : "testDB", "partitioned" : true, "primary" : "shard01" } testDB.testColl shard key: { "a" : 1 } chunks: shard01 2 { "a" : { "$minKey" : 1 } } -->> { "a" : 3 } on : shard01 Timestamp(1, 1) { "a" : 3 } -->> { "a" : { "$maxKey" : 1 } } on : shard01 Timestamp(1, 2) tag: asdf { "a" : 3 } -->> { "a" : 5 } { "_id" : "grades", "partitioned" : false, "primary" : "shard02" } mongos>