[DOCS-3934] Add to documentation: sh.addTagRange() splits chunks at min Created: 22/Aug/14  Updated: 30/Oct/23  Resolved: 31/Jan/18

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Minor - P4
Reporter: William Cross Assignee: Steve Renaker (Inactive)
Resolution: Done Votes: 0
Labels: bite-sized
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 2 weeks ago
Story Points: 0.25

 Description   

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>



 Comments   
Comment by Steve Renaker (Inactive) [ 31/Jan/18 ]

Closing this ticket on the grounds that this page no longer exists (now redirects to /core/sharding-data-partitioning/).

Generated at Thu Feb 08 07:46:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.