Description描述
InconsistentIndexAn index exists on two different shards that contains differing metadata or a specific index is missing on some shards.索引存在于包含不同元数据的两个不同分片上,或者某些分片上缺少特定索引。New in version 7.0.在版本7.0中新增。
Format格式
{
type: "InconsistentIndex",
description: "<string>",
details: {
namespace: "<string>",
info: <document>
}
}
InconsistentIndex inconsistency documents contain the following fields:不一致文档包含以下字段:
type | InconsistentIndex for this inconsistency type.InconsistentIndex值。 | |
description | ||
details | ||
details.namespace | ||
details.info |
Example示例
Use the 使用db.adminCommand() method to call the checkMetadataConsistency command:db.adminCommand()方法调用checkMetadataConsistency命令:
db.adminCommand( {
checkMetadataConsistency: 1,
checkIndexes: true
} )
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 该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了一个带有InconsistentIndex inconsistency document:InconsistentIndex不一致文档的游标:
{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "InconsistentIndex",
description: "Found an index of a sharded collection that is inconsistent between different shards",
details: {
namespace: "test.authors",
info: {
missingFromShards: [
"shard-rs1"
],
inconsistentProperties: [ ],
indexName: "index1"
}
}
}
],
},
ok: 1
}