[DOCS-11376] Incorrect command in the example used in "Merge Chunks in a Sharded Cluster" Created: 01/Mar/18  Updated: 30/Oct/23  Resolved: 12/Dec/18

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

Type: Improvement Priority: Major - P3
Reporter: Miguel Angel Nieto Assignee: Kay Kim (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-1837 Document Merge chunks command Closed
Participants:
Days since reply: 5 years, 9 weeks ago
Epic Link: DOCSP-1769

 Description   

There is an example in Merge Chunks documentation page to show how the command works. But it is wrong and a bit confusing.

Based on the first sh.status output, the following command won't work:

db.runCommand( { mergeChunks: "test.users",
                 bounds: [ { "username": "user68982" },
                           { "username": "user95197" } ]
             } )

Because the collection test.users doesn't have any chunk that starts with "user68982" or ends with "user95197". A user following the example will get this error:

"errmsg" : "could not merge chunks, collection test.users does not contain a chunk starting at { users: \"user68982\" } or ending at { users: \"user95197\" }"

Still, even ignoring the fact that the command won't work, the resulting sh.status() on the documentation makes no sense. There are merges done there that are not in the range specified anyway.

This should be the correct example.

Pre-merge chunks:

{ "username" : { "$minKey" : 1 } } -->> { "username" : "user16643" } on : shard02 Timestamp(2, 0) }}
{ "username" : "user16643" } -->> { "username" : "user2329" } on : shard02 Timestamp(3, 0) 
{ "username" : "user2329" } -->> { "username" : "user36583" } on : shard02 Timestamp(4, 0) 
{ "username" : "user36583" } -->> { "username" : "user43229" } on : shard02 Timestamp(5, 0) 
{ "username" : "user43229" } -->> { "username" : "user49877" } on : shard02 Timestamp(6, 0) 
{ "username" : "user49877" } -->> { "username" : "user56522" } on : shard02 Timestamp(7, 0) 
{ "username" : "user56522" } -->> { "username" : "user63169" } on : shard01 Timestamp(7, 1) 
{ "username" : "user63169" } -->> { "username" : "user69816" } on : shard01 Timestamp(1, 15) 
{ "username" : "user69816" } -->> { "username" : "user76462" } on : shard01 Timestamp(1, 17) 
{ "username" : "user76462" } -->> { "username" : "user83108" } on : shard01 Timestamp(1, 19) 
{ "username" : "user83108" } -->> { "username" : "user96401" } on : shard01 Timestamp(1, 21) 
{ "username" : "user96401" } -->> { "username" : { "$maxKey" : 1 } } on : shard01 Timestamp(1, 22)

Merge Command:

It would be important to mention in the documentation that this command needs to be run on admin database.

db.runCommand( { mergeChunks: "test.users",
                 bounds: [ { "username": "user63169" },
                           { "username": "user96401" } ]
             } )

Post-merge chunks:

{ "username" : { "$minKey" : 1 } } -->> { "username" : "user16643" } on : shard01 Timestamp(8, 0) 
{ "username" : "user16643" } -->> { "username" : "user2329" } on : shard02 Timestamp(8, 1) 
{ "username" : "user2329" } -->> { "username" : "user36583" } on : shard02 Timestamp(4, 0) 
{ "username" : "user36583" } -->> { "username" : "user43229" } on : shard02 Timestamp(5, 0) 
{ "username" : "user43229" } -->> { "username" : "user49877" } on : shard02 Timestamp(6, 0) 
{ "username" : "user49877" } -->> { "username" : "user56522" } on : shard02 Timestamp(7, 0) 
{ "username" : "user56522" } -->> { "username" : "user63169" } on : shard01 Timestamp(7, 1) 
{ "username" : "user63169" } -->> { "username" : "user96401" } on : shard01 Timestamp(7, 2) 
{ "username" : "user96401" } -->> { "username" : { "$maxKey" : 1 } } on : shard01 Timestamp(1, 22) 



 Comments   
Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11376: fix merge-chunks-in-sharded-cluster tutorial
Branch: v3.2
https://github.com/mongodb/docs/commit/14e41e418d1587c8da6f25b76c6862ee2c49d087

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11376: fix merge-chunks-in-sharded-cluster tutorial
Branch: v3.4
https://github.com/mongodb/docs/commit/080f48ef9d8a48d39199ea2c7df7e1ea91d69d2b

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: Revert "DOCS-11376: trivial: fix highlight line number" – meant only for 4.0 and master

This reverts commit 708e2e768368852aadb0c34ebfd803ca2c36328f.
Branch: v3.6
https://github.com/mongodb/docs/commit/97aa76314db5a1b829b4a229f4675ccd4c2ea4ed

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-11376: trivial: fix highlight line number
Branch: v4.0
https://github.com/mongodb/docs/commit/4313e1d7e36b7fed73be7ec08da50b6a21c30086

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-11376: trivial: fix highlight line number
Branch: v3.6
https://github.com/mongodb/docs/commit/708e2e768368852aadb0c34ebfd803ca2c36328f

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'Kay Kim', 'email': 'kay.kim@mongodb.com'}

Message: DOCS-11376: trivial: fix highlight line number
Branch: master
https://github.com/mongodb/docs/commit/4e10371a75453c326ea3fe92bd731e4ec831caf5

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11376: fix merge-chunks-in-sharded-cluster tutorial
Branch: master
https://github.com/mongodb/docs/commit/b4a7b8b8f1ef3e80b18fe1b104c8aee7ec2edc0a

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11376: fix merge-chunks-in-sharded-cluster tutorial
Branch: v4.0
https://github.com/mongodb/docs/commit/ccf14bdd9195dcb49de027527fd03afbf92fd65a

Comment by Githook User [ 12/Dec/18 ]

Author:

{'name': 'kay', 'email': 'kay.kim@10gen.com', 'username': 'kay-kim'}

Message: DOCS-11376: fix merge-chunks-in-sharded-cluster tutorial
Branch: v3.6
https://github.com/mongodb/docs/commit/6e6e1124d8d71046e09fce3253ca185f3a62258e

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