[SERVER-6348] Create ChunkStats command to replace the sh.status() chunk portion Created: 07/Jul/12  Updated: 05/Dec/22  Resolved: 23/Nov/22

Status: Closed
Project: Core Server
Component/s: Admin, Sharding, Shell
Affects Version/s: 2.1.2
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Scott Hernandez (Inactive) Assignee: [DO NOT USE] Backlog - Sharding EMEA
Resolution: Done Votes: 0
Labels: chunks, commands, sharding, sharding-common-backlog, stats
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-13985 printShardingStatus uses group/JS Closed
Related
is related to SERVER-16340 Mongo shell javascript sharding admin... Closed
Assigned Teams:
Sharding EMEA
Participants:

 Description   

Create a command to produce stats (group/count) stats. This would allow an option for sh.status() to pass in an arg

{mode:"tags"}

, versus what I will call

{mode:"chunks"}

which is the current default, to group by tag by shard (so you can see the distribution of chunks across shards for each tag) rather than by just by shard.

Here is the proposed command output:

{
	"collections" : [
		{
			"ns" : "foo.test1",
			"shard0000" : {
				"chunks" : 3,
				"jumboChunks" : 0,
				"taggedChunks" : {
					"a" : 2,
					"b" : 0,
					"$default" : 1
				}
			},
			"shard0001" : {
				"chunks" : 9,
				"jumboChunks" : 0,
				"taggedChunks" : {
					"a" : 5,
					"b" : 3,
					"$default" : 1
				}
			},
			"shard0002" : {
				"chunks" : 3,
				"jumboChunks" : 0,
				"taggedChunks" : {
					"a" : 0,
					"b" : 3,
					"$default" : 0
				}
			}
		}
	],
	"ok" : 1
}



 Comments   
Comment by Tommaso Tocci [ 23/Nov/22 ]

We deprecated the legacy shell in 6.0 in favor of the new mongosh. Moreover chunks are stored in config.chunks and can be easily inspected through our powerful query language.

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