|
Outcome of the [inefficient & dirty-coded] POC:
- It was possible to modify the balancer in order to take into account the data size on shards rather than the number of chunks (with an additional broadcast to all shards at the beginning of each round).
- Implemented donateData command received from shards with parameters (namespace, toShard, minBound) that - at moment - simply calls into moveChunk to move the chunk with minBound.
- The moveChunk call triggered in balancing rounds has been replaced with a call to donateData
Relevant problems discovered while POC-ing:
- Since dataSize includes orphans, in order for the balancer to work properly we need to track orphans somehow . For the POC, instead of calling dataSize the balancer is relying on countDocuments, but that is obviously not a viable solution because it means performing a whole index scan for every collection at every round.
|