feat(shell-api): support sh.shardDrainingStatus() and sh.getTransitionToDedicatedConfigServerStatus() MONGOSH-2501#2782
Open
ivandevp wants to merge 2 commits into
Open
feat(shell-api): support sh.shardDrainingStatus() and sh.getTransitionToDedicatedConfigServerStatus() MONGOSH-2501#2782ivandevp wants to merge 2 commits into
ivandevp wants to merge 2 commits into
Conversation
…icatedConfigServerStatus MONGOSH-2501
ivandevp
commented
Jul 22, 2026
Comment on lines
+2250
to
+2261
| shardDrainingStatus: { | ||
| link: 'https://mongodb.com/docs/manual/reference/method/sh.shardDrainingStatus', | ||
| description: | ||
| 'Returns the draining status of the given shard, or of all draining shards if no shard is specified. Uses the shardDrainingStatus admin command.', | ||
| example: 'sh.shardDrainingStatus(shardId?)', | ||
| }, | ||
| getTransitionToDedicatedConfigServerStatus: { | ||
| link: 'https://mongodb.com/docs/manual/reference/method/sh.getTransitionToDedicatedConfigServerStatus', | ||
| description: | ||
| 'Returns the draining status of the config shard while transitioning to a dedicated config server. Uses the getTransitionToDedicatedConfigServerStatus admin command.', | ||
| example: 'sh.getTransitionToDedicatedConfigServerStatus()', | ||
| }, |
Collaborator
Author
There was a problem hiding this comment.
These changes will require docs update as they do not exist today.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server epic SPM-4275 ("RemoveShard Interface Improvements") introduced a decomposed shard-removal workflow on mongod/mongos, including a
shardDrainingStatusadmin command that reports draining progress for a given shard (or all draining shards if none is specified). A related change, SERVER-110790, exposes the same status information for the config-shard-to-dedicated-config-server transition under its own command name,getTransitionToDedicatedConfigServerStatus, so that the public naming stays conceptually separate from generic shard removal.This PR surfaces both as
sh.*shell helpers:Changes
sh.shardDrainingStatus(shardId?)— returns the draining status of the given shard, or of all currently draining shards if noshardIdis passed. Gated to server versions>= 8.2.0(first release containingSERVER-107016/SERVER-106558).sh.getTransitionToDedicatedConfigServerStatus()— takes no arguments, returns the config shard's draining status. Gated to server versions>= 8.3.0(first release containingSERVER-110790).getConfigDB()first (to confirm the client is connected to mongos, matching the existingisBalancerRunning/isConfigShardEnabledpattern) and use_runAdminReadCommandsince these are read-only status queries.en_USi18n help text and examples for both new attributes.shardIdcases, result pass-through, error pass-through, and the not-connected-to-mongos warning.Notes
mongodb/mongocommit history between release branch cuts, since the Jira tickets only stated the docs "debut in 9.0" rather than the actual command availability.sh.listShards()'s newdrainingfilter (a related but separate change) is tracked in MONGOSH-2500 / feat(shell-api): support filter arg in sh.listShards() MONGOSH-2500 #2776 and is not part of this PR.