Database Manual / Sharding / Reference / Inconsistency Types

RangeDeletionMissingShardKeyIndex

Description描述

RangeDeletionMissingShardKeyIndex

A sharded collection exists that doesn't have an index compatible with the collection shard key and there is at least one remaining range deletion task to complete.存在一个分片集合,其索引与集合分片键不兼容,并且至少还有一个剩余的范围删除任务需要完成。

New in version 8.2.在版本8.2中新增。

Format格式

{
type: "RangeDeletionMissingShardKeyIndex",
description: "<string>",
details: {
namespace: "<string>",
shard: "<string>",
shardKey: { <document> }
}
}

RangeDeletionMissingShardKeyIndex inconsistency documents contain the following fields:不一致文档包含以下字段:

Field字段Type类型Description描述
typestring字符串Type of inconsistency document. Returns a value of RangeDeletionMissingShardKeyIndex for this inconsistency type.不一致文档的类型。为此不一致类型返回RangeDeletionMissingShardKeyIndex的值。
descriptionstring字符串Describes the inconsistency found in the metadata.描述元数据中发现的不一致。
detailsdocument文档Document with additional information on where the inconsistency exists in the database and sharded cluster.包含数据库和分片集群中不一致位置的附加信息的文档。
details.namespacestring字符串Indicates the database and collection where the inconsistency exists.指示存在不一致的数据库和集合。
details.shardstring字符串The shard where the inconsistency exists.存在不一致的分片。
details.shardKeydocument文档The shard key that requires an index.需要索引的分片键。

Example示例

Use the db.adminCommand() method to call the checkMetadataConsistency command:使用db.adminCommand()方法调用checkMetadataConsistency命令:

db.adminCommand( { checkMetadataConsistency: 1 } )

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 RangeDeletionMissingShardKeyIndex inconsistency document:该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了一个带有RangeDelegationMissingShardKeyIndex不一致文档的游标:

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "RangeDeletionMissingShardKeyIndex",
description: "Found sharded collection with an outstanding range deletion task without a shard key index",
details: {
namespace: "test.authors",
shard: "shard-rs0",
shardKey: {
skey: 1
}
}
}
],
},
ok: 1
}