路由表范围间隙
描述
格式
{ type: "RoutingTableRangeGap", description: "<string>", details: { namespace: "<string>", collectionUUID: <string>, chunkA: {<document>}, chunkB: {<document>} } }
RoutingTableRangeGap
不一致文档包含以下字段
字段 | 类型 | 描述 |
---|---|---|
类型 | 字符串 | 不一致文档的类型。对于此不一致类型,返回值为 |
描述 | 字符串 | 描述在元数据中找到的不一致性。 |
细节 | 文档 | 包含有关数据库和分片集群中不一致存在的额外信息的文档。 |
details.namespace | 字符串 | 指示存在不一致的数据库和集合。 |
details.collectionUUID | UUID | 集合的UUID。 |
details.chunkA | 文档 | 与第二个块有差距的第一个块。 |
details.chunkB | 文档 | 与第一个块有差距的第二个块。 |
示例
使用db.adminCommand()
方法调用 checkMetadataConsistency
命令
db.adminCommand( { checkMetadataConsistency: 1 } )
该方法返回一个包含在分片元数据中发现的不一致性文档的批次的游标。下面的示例显示了一个包含 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 }