说明
format
{ type: "InconsistentShardCatalogCollectionMetadata", description: "<string>", details: { namespace: "<string>", collectionUUID: <UUID>, details: <document> } }
ZonesRangeOverlap 不一致文档包含以下字段:
字段 | 类型 | 说明 |
|---|---|---|
| 字符串 | 不一致文档的类型。 为此不一致类型返回值 |
| 字符串 | 描述在元数据中发现的不一致之处。 |
| 文档 | 包含有关数据库和分片集群中哪些位置存在不一致的附加信息的文档。 |
| 字符串 | 指示存在不一致的数据库和collection。 |
| UUID | 集合的 UUID。 |
| 文档 | 描述配置服务器和分片目录之间不同字段的文档。 |
例子
使用db.adminCommand()方法调用checkMetadataConsistency命令:
db.adminCommand( { checkMetadataConsistency: 1 } )
该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。 以下示例显示了带有ZonesRangeOverlap不一致文档的游标:
{ cursor: { id: Long("0"), ns: "admin.$cmd.aggregate", firstBatch: [ { type: "InconsistentShardCatalogCollectionMetadata", description: "Found inconsistencies between collection metadata in the global catalog and the shard catalog", details: { namespace: "test.authors", collectionUUID: UUID("2153613e-f166-437b-99b1-b8711d1cc4ac"), details: { field: "shardCatalogEntry", source: "inMemoryShardCatalog", shardCatalog: { _id: "test.authors", lastmodEpoch: ObjectId("6a5a079ca93d70776b2e715c"), timestamp: Timestamp({ t: 1784285084, i: 36 }), uuid: UUID("baeb3cb1-d16f-4b8f-8342-544e52e56d9c"), key: { author: 1 }, unique: false, lastmod: ISODate("2026-07-17T10:44:52.275Z") }, globalCatalog: { _id: "test.authors", lastmodEpoch: ObjectId("6a5a079ca93d70776b2e715c"), timestamp: Timestamp({ t: 1784285084, i: 36 }), uuid: UUID("2153613e-f166-437b-99b1-b8711d1cc4ac"), key: { author: 1 }, unique: false, lastmod: ISODate("2026-07-17T10:44:44.396Z") } } } } ], }, ok: 1 }