MongoDB Shard Zone Range Overlapping

mongodbsharding

I am configuring a test mongo setup with 2 shards, and I'm trying to add zone ranges to each shard:

sh.updateZoneKeyRange('mydb.test', {id:MinKey,ts:MinKey}, {id:MaxKey,ts:1548787704000}, 'cold')

sh.updateZoneKeyRange('mydb.test', {id:MinKey,ts:1548787704000}, {id:MaxKey,ts:MaxKey}, 'hot')

First command runs fine, but second tells me:

Zone range: { id: MinKey, ts: 1548787704000.0 } -->> { id: MaxKey, ts: MaxKey } on hot is overlapping with existing: { id: MinKey, ts: MinKey } -->> { id: MaxKey, ts: 1548787704000.0 } on cold

I thought the maximum bounds were exclusive and minimum bounds inclusive?

Best Answer

From what I can gather after some experiments, it seems that the prefix range is the one that must be split.