Hi Nikolay
I believe the confusion came from this sentence:
on reaching some thresholds, balancer starts actual chunks migration between shards to balance the chunks distribution.
The page in question was talking about the balancer’s method of balancing the number of chunks across the sharded cluster. What you’re missing is the information regarding the data partitioning with chunks. To paraphrase:
MongoDB uses the shard key associated to the collection to partition the data into chunks. A chunk consists of a subset of sharded data. Each chunk has a inclusive lower and exclusive upper range based on the shard key.
So, using my example, mongodb will automatically adjust the shards’ range
The shard key range is not “adjusted” (i.e. not modified), but instead a chunk that contains a continuous range of the shard key is split into two (or more) chunks. The Chunk Splits section describes this process in more details.
I believe the Data Partitioning with Chunks page should have the answer to all your questions regarding chunks and its balancing process.
Best regards,
Kevin