[DOCS-8140] Document the new balancer control commands and the deprecation of the old shell's balancer control scripts Created: 21/Jun/16  Updated: 04/Mar/23  Resolved: 28/Nov/16

Status: Closed
Project: Documentation
Component/s: Server
Affects Version/s: None
Fix Version/s: 3.4.0, mongodb-3.4p1, DOCS Q3 W10, DOCS Q3 W10-part_deux

Type: Task Priority: Critical - P2
Reporter: Kaloian Manassiev Assignee: Kay Kim (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-24720 Move the balancer status from the ser... Closed
Related
related to SERVER-25361 Deploying a v3.2 cluster with v3.4 co... Closed
Participants:
Days since reply: 7 years, 11 weeks, 2 days ago
Epic Link: 3.4: Sharding Updates
Story Points: 1.5

 Description   

Prior to v3.4, the start/stopBalancer shell scripts were using the config.settings section plus the state of the balancer lock in order to set the balancer state.

In sharding 3.4, the balancer is running on the CSRS primary and it permanently holds the balancer lock in order to prevent any legacy 3.2 mongos instance from attempting to do balancing. Since the old shell scripts for start/stopBalancer relied on the state of the balancer lock to determine whether it is running, with this change these old scripts no longer work.

The new way to interact with the balancer in 3.4 is through the startBalancer/stopBalancer/balancerStatus commands. The way they work is:

  • startBalancer - starts the balancer thread, but does not wait for a balancer round.
  • stopBalancer - waits for any active balancer round to complete and then stops the balancer. No more balancing will occur until startBalancer is called.
  • balancerStatus - returns information about the run-time status of the balancer. This information is available on both primary and secondary, but only meaningful when read from the primary:
    • mode (string) - State of the balancer. Can be one of "full" (balancer is active, but not necessarily doing balancing at this moment), "off" (balancer is stopped and will not be doing any chunk movements).
    • inBalancerRound (boolean) - indicates whether the balancer is currently actively moving chunks or sleeping.
    • numBalancerRounds (number) - indicates the number of balancer rounds which have been done since the node was last started. This value is not persisted anywhere, is reset to 0 on node restart and will remain at its last value if the node is not primary or if the balancer is stopped.

Backwards compatibility
This section is about the backwards compatibility of the start/stopBalancer shell scripts.

The 3.4 shell is backwards compatible with sharded clusters, which are running all components on 3.2 or earlier (config, shards and mongos).

The 3.2 and earlier shell is not compatible with 3.4 clusters.

For clusters which are in the process of being upgraded, the following rules apply:

If only the CSRS config server primary has been upgraded to 3.4, but not the shards and mongos, neither the old shell balancer control will work, nor the 3.4 one. In order to be able to control the balancer in this state, a one-off mongos instance needs to be spawned so the balancer control commands are available.



 Comments   
Comment by Githook User [ 28/Nov/16 ]

Author:

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

Message: DOCS-8140 mongo shell balancer command updates per 3.4
Branch: master
https://github.com/mongodb/docs/commit/07ccfb0bb8fea115272540db62fadb4799f67303

Comment by Kay Kim (Inactive) [ 14/Oct/16 ]

I think we might have been looking at the wrong SERVER ticket. I believe the main SERVER ticket for this is indeed fixed and going.

The ticket you were looking at – that is an effect of the main SERVER ticket.

cc: emily.hall

Comment by Emily Hall [ 28/Sep/16 ]

Closing issue because linked Server ticket was resolved as "Won't Fix"

Generated at Thu Feb 08 07:55:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.