Database Manual / Sharding / Reference / Inconsistency Types

RoutingTableRangeGap

Description描述

RoutingTableRangeGap

A range gap exists in the routing table between two consecutive chunks for the same collection.同一集合的两个连续块之间的路由表中存在范围间隙。

New in version 7.0.在版本7.0中新增。

Format格式

{
type: "RoutingTableRangeGap",
description: "<string>",
details: {
namespace: "<string>",
collectionUUID: <string>,
chunkA: {<document>},
chunkB: {<document>}
}
}

RoutingTableRangeGap inconsistency documents contain the following fields:不一致文档包含以下字段:

Field字段Type类型Description描述
typestring字符串Type of inconsistency document. Returns a value of RoutingTableRangeGap for this inconsistency type.不一致文档的类型。返回此不一致类型的RoutingTableRangeGap值。
descriptionstring字符串Describes the inconsistency found in the metadata.描述元数据中发现的不一致。
detailsdocument文档Document with additional information on where the inconsistency exists in the database and sharded cluster.包含数据库和分片集群中不一致位置的附加信息的文档。
details.namespacestring字符串Indicates the database and collection where the inconsistency exists.指示存在不一致的数据库和集合。
details.collectionUUIDUUIDUUID of the collection.集合的UUID。
details.chunkAdocument文档The first chunk that has a gap with the second chunk.与第二块有间隙的第一块。
details.chunkBdocument文档The second chunk that has a gap with the first chunk.与第一块有间隙的第二块。

Example示例

Use the db.adminCommand() method to call the checkMetadataConsistency command:使用db.adminCommand()方法调用checkMetadataConsistency命令:

db.adminCommand( { checkMetadataConsistency: 1 } )

The method returns a cursor with a batch of documents showing the inconsistencies found in the sharding metadata. The example below shows a cursor with a RoutingTableRangeGap inconsistency document:该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了带有RoutingTableRangeGap不一致文档的游标:

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "RoutingTableRangeGap",
description: "Found a gap between two consecutive chunks",
details: {
namespace: "test.authors",
collectionUUID: new UUID("62ebdb7e-a7bb-4151-a620-49d44cef097f"),
chunkA: {
_id: ObjectId("64dde749ac6045c92ef3b9ad"),
uuid: new UUID("8c83ea89-ab6b-4ae4-91ab-813cf781284d"),
min: {
x: MinKey
},
max: {
x: 0
},
shard: "shard0000",
lastmod: Timestamp(1, 0),
onCurrentShardSince: Timestamp(1, 0),
history: [
{
validAfter: Timestamp(1, 0),
shard: "shard0000"
}
]
},
chunkB: {
_id: ObjectId("64dde749ac6045c92ef3b9af"),
uuid: new UUID("8c83ea89-ab6b-4ae4-91ab-813cf781284d"),
min: {
x: 10
},
max: {
x: MaxKey
},
shard: "shard0000",
lastmod: Timestamp(1, 0),
onCurrentShardSince: Timestamp(1, 0),
history: [
{
validAfter: Timestamp(1, 0),
shard: "shard0000"
}
]
}
}
}
],
},
ok: 1
}