Mondgod Shard: Clan breakdown failed with hashed key

I am trying to split multiple jumbo chunks in mongodb sharded cluster sharded using the hashed fragment key: {group_id: "hashed"}.

I used the following command from mongodb docs to split these jumbo pieces:

db.runCommand( { split: "test.people", bounds : [ { group_id: NumberLong("-5838464104018346494") }, { group_id: NumberLong("-5557153028469814163") } ] } ) 

But getting the following error:

 { "cause" : { }, "ok" : 0, "errmsg" : "split failed" }. 

What is the possible reason for this failure? The fragment key group_id has a capacity of 26231 against only 4521157 documents.

You checked this , but could not find the reason.

PS: group_id - ObjectId.

+6
source share
1 answer

Your way power is too small. One piece will automatically break when it reaches 64 MB.

Currently, with a capacity of 26231, your collection cannot exceed 26231 * a maximum of 64 MB without jumbo pieces ... And you will probably have problems long before that if you do not have a perfect distribution.

In your case, you do not have a group_id value, which results in a hash value between NumberLong ("- 5838464104018346494") and NumberLong ("- 5557153028469814163") ...

So you cannot break it, because your power is too small.

To summarize, you need the best shard key right away , which means mongodump everything, and then mongorestore with the new shard key.

0
source

Source: https://habr.com/ru/post/989002/


All Articles