Subject: [mongodb-user] Re: Chunks Migration violates Shard
Key?



Hi,
I think you are a little confused.
shard holds chunks that specify the shard range.
Using your example:
If shard1 has 250 chunks and shard2 has 5 chunks, during balancing, it will balance the chunk between them and ensure that they are holding similar amount of chunks. The shard range that is "hold" by the chunk will get moved as well.

On Tuesday, 8 August 2017 14:54:04 UTC+1, Nikolay Dmitriev wrote:Hi,
I have a question related to a chunks migration in a MongoDb Balanced Sharded Cluster.

According to Sharded Cluster Balancer manual page, on reaching some thresholds, balancer starts actual chunks migration between shards to balance the chunks distribution.
I don't understand and I could not find a clear answer - how does this process corellate with a shard key range?
How can a chunk with its own range of data based on a shard key be migrated to another shard that simply cannot hold that data because it has different shard key value boundaries?
I can assume this when a hashed sharding strategy is used - as I got it in this case mongodb operates hashed shard key value boundaries for shards on its own and probably can change them (???).
But I cannot understand this for a ranged sharding strategy.

E.g.,, I have 2 shards with a collection sharded on an X key:
1st holds data for X values from 1 to 1mlrd
2nd holds data for X values from 1mlrd to 2mlrd

How can a chunk from the 1st shard migrate to the 2nd when its data's shard keys doesn't fit into the 2nd shard shard key's value range?
Am I getting smth wrong about all this "chunk mig...

ration"?

Please, help. I'm stuck )))

--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: https://docs.mongodb.com/manual/support/
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/d1758083-e891-44f4-8e5c-097dbe72b6f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



Programming list archiving by: Enterprise Git Hosting