[SERVER-16340] Mongo shell javascript sharding admin functions not available in drivers Created: 27/Nov/14  Updated: 06/Dec/22  Resolved: 15/Nov/21

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

Type: New Feature Priority: Major - P3
Reporter: Joanna Cheng Assignee: [DO NOT USE] Backlog - Sharding EMEA
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-6357 Add tag based sharding commands Closed
related to SERVER-6348 Create ChunkStats command to replace ... Closed
Assigned Teams:
Sharding EMEA
Participants:
Case:

 Description   

The following sharding mongo shell functions are implemented in client-side JS, and rely on the current layout of the config database and the collections within

sh.disableBalancing
sh.enableBalancing
sh.getBalancerHost
sh.getBalancerState
sh.isBalancerRunning
sh.removeShardTag
sh.setBalancerState
sh.startBalancer
sh.stopBalancer
sh.waitForBalancer
sh.waitForBalancerOff
sh.waitForDLock
sh.waitForPingChange

If a customer wants to configure their sharded cluster outside of the shell (i.e. through a driver), they need to re-implement the above in their language of choice.

This unnecessarily exposes internal sharding implementation details to clients, which is an inappropriately fragile API for users to be dealing with. Any such client-side re-implementation of these functions is therefore brittle in the face of future changes to the sharding implementation (and upgrading across such changes would need to be very carefully managed).

The situation is similar to SERVER-14378, where querying system.indexes and system.namespaces were replaced with the listIndexes/listCollections commands, for similar reasons. It would be useful if there was also an API (at some level) to allow users to dynamically manage sharded environments via drivers.



 Comments   
Comment by Kaloian Manassiev [ 15/Nov/21 ]

Most of these operations are either no longer relevant (getBalancerHost, DistLock) or have been implemented as commands.

Comment by Joanna Cheng [ 27/Nov/14 ]

Some of the sharding related shell admin functions are already covered in other tickets

  • sh.status(), which is (partially) covered in SERVER-6348
  • sh.addShardTag / sh.addTagRange, which is covered in SERVER-6357
Generated at Thu Feb 08 03:40:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.