Question

I have a mongo shards cluster and a mongos instance. These servers are running on MongoDB 3.4.0. When I use mongo shell 3.4.0 to connect to the mongos, I got below output from sh.isBalancerRunning(),

mongos> sh.isBalancerRunning()
false

but I got a different result when I use mongo shell 3.2.13:

mongos> sh.isBalancerRunning()
true

Is this something not compatible between mongo versions? If yes, why other commands work fine just this command doesn't?

Was it helpful?

Solution

The difference is that 3.4 balancing work is done by config server primary and at 3.2 it was done by one of the mongos services.

To prevent "older" (<3.4) mongos services to start balancing work, config server (>=3.4) makes "lock" document to the local collection, what "states" that one of the mongos services have "balancing lock" set.

That document doesn't prevent (>=3.4) config server to do balancing. That is the reason why older mongos "report" that there is always balancing ongoing!

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top