说明
format
{ type: "LegacyShardCacheCollectionsPresent", description: "<string>", details: { namespace: "<string>", shard: "<string>" } }
LegacyShardCacheCollectionsPresent 不一致文档包含以下字段:
字段 | 类型 | 说明 |
|---|---|---|
| 字符串 | 不一致文档的类型。 为此不一致类型返回值 |
| 字符串 | 描述在元数据中发现的不一致之处。 |
| 文档 | 包含有关数据库和分片集群中哪些位置存在不一致的附加信息的文档。 |
| 字符串 | 指示存在不一致的数据库和collection。 |
| 字符串 | 存在不一致的分片。 |
例子
使用db.adminCommand()方法调用checkMetadataConsistency命令:
db.adminCommand( { checkMetadataConsistency: 1 } )
该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。 以下示例显示了带有LegacyShardCacheCollectionsPresent不一致文档的游标:
{ cursor: { id: Long("0"), ns: "test.$cmd.aggregate", firstBatch: [ { type: "LegacyShardCacheCollectionsPresent", description: "Found legacy non-authoritative shard catalog cache collections on a shard that is fully upgraded", details: { namespace: "config.cache.collections", shard: "shard-rs0" } } ], }, ok: 1 }