[DOCS-12618] The arguments for splitChunk are not documented correctly Created: 11/Apr/19  Updated: 30/Oct/23

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

Type: Bug Priority: Minor - P4
Reporter: Dmitry Ryabtsev Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769
Story Points: 0.1

 Description   

Description

Here the first field name is said to be ns, but in fact the name of the field that specifies the namespace is splitChunk. Here is an example of the command logged by the server on v3.6:

Show all

2019-04-11T18:29:10.364+1000 I COMMAND  [conn48] command admin.$cmd appName: "MongoDB Shell" command:   splitChunk {
  	splitChunk: "test.s",
  	from: "myShard_0",
  	keyPattern: {
  		_id: "hashed"
  	},
  	epoch: ObjectId('5caee45fa3d6aee92bcb4aa4'),
  	shardVersion: [Timestamp(12, 1), ObjectId('5caee45fa3d6aee92bcb4aa4')],
  	min: {
  		_id: 5711438324243501269
  	},
  	max: {
  		_id: 6918684992004911231 splitKeys: [{
  			_id: 6316025472438991097
  		}],
  		lsid: {
  			id: UUID("f783a577-4dfb-4f1d-8916-2b99ed81f1b7"),
  			uid: BinData(0, 3 B408CB48548B5037822C10EB0976B3CBF2CEE3BF9C708796BF03941FBECD80)
  		},
  		$clusterTime: {
  			clusterTime: Timestamp(1554971349, 1),
  			signature: {
  				hash: BinData(0, 0000000000000000000000000000000000000000),
  				keyId: 0
  			}
  		},
  		$client: {
  			application: {
  				name: "Mongo Shell"
  			},
  			driver: {
  				name: "MongoDB Internal Client",
  				version: "4.0.6"
  			},
  			os: {
  				type: "Linux",
  				name: "Ubuntu",
  				architecture: "x86_64",
  				version: "14.04"
  			},
  			mongos: {
  				host: "lubuntu:27017",
  				client: "127.0.0.1:59094",
  				version: "3.6.7"
  			}
  		},
  		$configServerState: {
  			opTime: {
  				ts: Timestamp(1554971349, 1),
  				t: 4
  			}
  		},
  		$db: "admin"
  	}
  	numYields: 0 reslen: 268 locks: {
  		Global: {
  			acquiCount: {
  				r: 2
  			}
  		},
  		Database: {
  			acquireCount: {
  				r: 1
  			}
  		},
  		Collection: {
  			acquireCount: {
  				r: 1
  			}
  		}
  	}
  	protocol: op_msg 54 ms

Another issue is shardId. As per the above log, the shard names is passed via the from field. The shardId field is not present needed.

One more - splitKeys takes an array of split points so splitChunk can potentially split chunk in more than one point.

Finally, shardVersion is required, but not listed.

Thus for v3.6 and above the list of arguments should look like:

Field Type Description
splitChunk string The complete namespace of the chunk to split.
keyPattern document The shard key.
min document The lower bound of the shard key for the chunk to split.
max document The upper bound of the shard key for the chunk to split.
from string The shard that owns the chunk to split.
splitKeys array of documents The split points for the chunk.
shardVersion array The shard version of the namespace.

For v3.4 it should be:

Field Type Description
splitChunk string The complete namespace of the chunk to split.
keyPattern document The shard key.
min document The lower bound of the shard key for the chunk to split.
max document The upper bound of the shard key for the chunk to split.
from string The shard that owns the chunk to split.
splitKeys array of documents The split points for the chunk.
shardVersion array The shard version of the namespace.
configdb string Connection string for the CSRS

Right now we shows the same list of fields regardless of the MongoDB version toggled in the documentation.

Scope of changes

  • Navigate the MongoDB code base to validate the required fields for splitChunks
  • Document them for 4.2, 4.0, 3.6
  • update fields - do not provide examples, as this is still an internal-only command
  • Confirm w/ sharding for external review.

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Comment by James Kovacs [ 17/Mar/20 ]

In MongoDB 3.6+, SERVER-27632 changed shardVersion to epoch. We should either update the documentation to correctly list the fields or remove the field list since it is an internal command.

Generated at Thu Feb 08 08:05:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.