路由表缺少最小键
描述
格式
{ type: "RoutingTableMissingMinKey", description: "<string>", details: { namespace: "<string>", collectionUUID: <string>, minKeyObj: { <document> }, globalMin: { <document> } } }
RoutingTableMissingMinKey
不一致性文档包含以下字段
字段 | 类型 | 描述 |
---|---|---|
类型 | 字符串 | 不一致性文档的类型。对于此不一致性类型,返回 |
description | 字符串 | 描述在元数据中找到的不一致性。 |
details | 文档 | 包含有关不一致性在数据库和分片集群中存在位置额外信息的文档。 |
details.namespace | 字符串 | 指示存在不一致性的数据库和集合。 |
details.collectionUUID | UUID | 集合的UUID。 |
details.minKeyObj | 文档 | 集合使用的最小键。 |
details.globalMin | 文档 | 集合预期的最小键。 |
示例
使用db.adminCommand()
方法调用 checkMetadataConsistency
命令
db.adminCommand( { checkMetadataConsistency: 1 } )
该方法返回一个游标,其中包含一批文档,显示在分片元数据中找到的不一致性。以下示例显示了一个包含 RoutingTableMissingMinKey
不一致性文档的游标
{ cursor: { id: Long("0"), ns: "test.$cmd.aggregate", firstBatch: [ { type: "RoutingTableMissingMinKey", description: "Routing table has a gap because first chunk does not start from MinKey", details: { namespace: "test.authors", collectionUUID: new UUID("62ebdb7e-a7bb-4151-a620-49d44cef097f"), minKeyObj: { x: 0 }, globalMin: { x: MinKey } } } ], }, ok: 1 }