Database sharding support for incremental sync
What I tried
- Stop balancer through Mongos of Source MongoDB
- Enable shard for a specific collection through Mongos
- Insert some data to that collection while running incremental sync
What I expected In target MongoDB, those collection also stored according to sharded partition of source MongoDB
But every document synced from the source MongoDB is storing to the default primary shard for that collection in target MongoDB
May be the config server also needs to sync for this purpose. Is this support available till now in Mongo shake ?
Source MongoDB sharding status ---> https://gist.github.com/sayedppqq/2ac4544057a07002b0ba431ac67f28da Target MongoDB sharding status -----> https://gist.github.com/sayedppqq/da41e37f666716d75026a59888da7beb
Do not support sync data in config server. All data synced from source MongoDB to dest MongoDB will have totally diff router data(config.chunks).
workaround: you can try run shardCollection and do pre-split on dest MongoDB also, and then insert data while running incremental sync.
Also, there is no specified oplog related to 'shardCollection' cmd. If you run shardCollection cmd, you will find below ops on shard:
c create
c createIndexes
i config.cache.databases
i config.cache.collections
c create // cache.chunks.xxxx
c createIndexes // cache.chunks.xxxx
...
Clear historical issues that have not been closed. If anyone has the same problem, please raise a new issue and link it. Thank you.