Description描述
CorruptedZoneShardKeyThe routing table contains a zone with a min key or max key that doesn't correspond to the collection shard key.路由表包含一个区域,其最小键或最大键与集合分片键不对应。New in version 7.0.在版本7.0中新增。
Format格式
{
type: "CorruptedZoneShardKey",
description: "<string>",
details: {
namespace: "<string>",
collectionUUID: UUID("<uuid>"),
zone: <zone>,
shardKeyPattern: <pattern>
}
}
CorruptedZoneShardKey inconsistency documents contain the following fields:不一致文档包含以下字段:
type | CorruptedZoneShardKey for this inconsistency type.CorruptedZoneHardKey值。 | |
description | ||
details | ||
details.namespace | ||
details.collectionUUID | UUID | |
details.zone | ||
details.shardKeyPattern |
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 该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了一个带有CorruptedZoneShardKey inconsistency document:CorruptedZoneShardKey不一致文档的游标:
{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "CorruptedZoneShardKey",
description: "Found zone with a shard key pattern violation",
details: {
namespace: "test.authors",
collection: {
collectionUUID : new UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4"),
zone : {
ns : "test.authors",
tag: "64ddd81656be208c6685da21",
min: {
y: 0
},
max: {
x: MaxKey
}
},
shardKeyPattern: {
x: 1
}
}
}
}
],
},
ok: 1
}