1

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?

0

1 Answer 1

0

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!

2
  • Thanks for this explanation. One question is what you mean by ` config server (>=3.4) makes "lock" document to the local collection`. Does this mean the config server always lock the local collection? Commented Oct 6, 2017 at 22:59
  • With "local" I mean config servers config DB and there locks collection. docs.mongodb.com/manual/reference/config-database/#config.locks
    – JJussi
    Commented Oct 7, 2017 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.