Eu tenho uma coleção de fragmentos em que a chave de fragmento é um campo chamado "uuid". O valor deste campo é do tipo string e representa valores hexadecimais, ou seja, uma string hexadecimal. Para cada documento este campo "uuid" é único.
Os dados são divididos em pedaços automaticamente pelo MongoDB. Não consigo descobrir como o MongoDB está dividindo essa string hexadecimal em intervalos contíguos. Não há documentos que expliquem como o Mongo forma essas faixas
Você pode me ajudar a entender como esses intervalos são formados?
Para uma amostra, inseri 3025357 documentos com os referidos valores hexadecimais. Os pedaços e os intervalos associados a eles são,
{
"_id" : "database.sha_shard-uuid_MinKey",
"lastmod" : Timestamp(2, 0),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : { "$minKey" : 1 }
},
"max" : {
"uuid" : "000043c071f23fc889275f77f950c649faac92e0"
},
"shard" : "shardRpSet2",
"history" : [
{
"validAfter" : Timestamp(1577632842, 37),
"shard" : "shardRpSet2"
}
]
},{
"_id" : "database.sha_shard-uuid_\"5b935a89d91977490d04f740a86bccc2b3cc2bfb\"",
"lastmod" : Timestamp(3, 5),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "5b935a89d91977490d04f740a86bccc2b3cc2bfb"
},
"max" : {
"uuid" : "7a25fa7aa3a86ed259f646d7890db370e8b43ae7"
},
"shard" : "shardRpSet1",
"history" : [
{
"validAfter" : Timestamp(1577632856, 21509),
"shard" : "shardRpSet1"
}
]
},{
"_id" : "database.sha_shard-uuid_\"7a25fa7aa3a86ed259f646d7890db370e8b43ae7\"",
"lastmod" : Timestamp(3, 6),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "7a25fa7aa3a86ed259f646d7890db370e8b43ae7"
},
"max" : {
"uuid" : "810b573464d4894fc40b428ec82ec54d9a681bf6"
},
"shard" : "shardRpSet1",
"history" : [
{
"validAfter" : Timestamp(1577632856, 21509),
"shard" : "shardRpSet1"
}
]
},{
"_id" : "database.sha_shard-uuid_\"000043c071f23fc889275f77f950c649faac92e0\"",
"lastmod" : Timestamp(4, 0),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "000043c071f23fc889275f77f950c649faac92e0"
},
"max" : {
"uuid" : "1e8421c5d4f3eb45a82c2785bccc81fa7abfbfc7"
},
"shard" : "shardRpSet2",
"history" : [
{
"validAfter" : Timestamp(1577635896, 15268),
"shard" : "shardRpSet2"
}
]
},{
"_id" : "database.sha_shard-uuid_\"1e8421c5d4f3eb45a82c2785bccc81fa7abfbfc7\"",
"lastmod" : Timestamp(5, 0),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "1e8421c5d4f3eb45a82c2785bccc81fa7abfbfc7"
},
"max" : {
"uuid" : "3d165990d2969bbaf79b6b0d790080b46ca5f056"
},
"shard" : "shardRpSet",
"history" : [
{
"validAfter" : Timestamp(1577635906, 26457),
"shard" : "shardRpSet"
}
]
},{
"_id" : "database.sha_shard-uuid_\"3d165990d2969bbaf79b6b0d790080b46ca5f056\"",
"lastmod" : Timestamp(5, 1),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "3d165990d2969bbaf79b6b0d790080b46ca5f056"
},
"max" : {
"uuid" : "5b935a89d91977490d04f740a86bccc2b3cc2bfb"
},
"shard" : "shardRpSet1",
"history" : [
{
"validAfter" : Timestamp(1577632856, 21509),
"shard" : "shardRpSet1"
}
]
},{
"_id" : "database.sha_shard-uuid_\"c1788722a31a5a5a5caa00816ad85aeeda26e581\"",
"lastmod" : Timestamp(5, 2),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "c1788722a31a5a5a5caa00816ad85aeeda26e581"
},
"max" : {
"uuid" : "dcbd245e03d425aa14a85b51befde274856fc5f3"
},
"shard" : "shardRpSet",
"history" : [
{
"validAfter" : Timestamp(1577630416, 3),
"shard" : "shardRpSet"
}
]
},{
"_id" : "database.sha_shard-uuid_\"dcbd245e03d425aa14a85b51befde274856fc5f3\"",
"lastmod" : Timestamp(5, 3),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "dcbd245e03d425aa14a85b51befde274856fc5f3"
},
"max" : {
"uuid" : "fffff8c5e160711fb48f0d38ce01a98880e869e2"
},
"shard" : "shardRpSet",
"history" : [
{
"validAfter" : Timestamp(1577630416, 3),
"shard" : "shardRpSet"
}
]
},{
"_id" : "database.sha_shard-uuid_\"fffff8c5e160711fb48f0d38ce01a98880e869e2\"",
"lastmod" : Timestamp(6, 0),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "fffff8c5e160711fb48f0d38ce01a98880e869e2"
},
"max" : {
"uuid" : { "$maxKey" : 1 }
},
"shard" : "shardRpSet2",
"history" : [
{
"validAfter" : Timestamp(1577636268, 67),
"shard" : "shardRpSet2"
}
]
},{
"_id" : "database.sha_shard-uuid_\"810b573464d4894fc40b428ec82ec54d9a681bf6\"",
"lastmod" : Timestamp(6, 1),
"lastmodEpoch" : ObjectId("5e08bad0b5e6b931087f0871"),
"ns" : "database.sha_shard",
"min" : {
"uuid" : "810b573464d4894fc40b428ec82ec54d9a681bf6"
},
"max" : {
"uuid" : "c1788722a31a5a5a5caa00816ad85aeeda26e581"
},
"shard" : "shardRpSet",
"history" : [
{
"validAfter" : Timestamp(1577630416, 3),
"shard" : "shardRpSet"
}
]
}