Description描述
CorruptedChunkShardKeyThe routing table contains a chunk 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: "CorruptedChunkShardKey",
description: "<string>",
details: {
namespace: "<string>",
collectionUUID: UUID("<uuid>"),
chunk: <chunk>,
shardKeyPattern: <pattern>
}
}
CorruptedChunkShardKey inconsistency documents contain the following fields:不一致文档包含以下字段:
type | CorruptedChunkShardKey for this inconsistency type.CorruptedChunkShardKey值。 | |
description | ||
details | ||
details.namespace | ||
details.collectionUUID | UUID | |
details.chunk | ||
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 该方法返回一个游标,其中包含一批文档,显示分片元数据中发现的不一致。下面的示例显示了一个带有CorruptedChunkShardKey inconsistency document:CorruptedChunkShardKey不一致文档的游标:
{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "CorruptedChunkShardKey",
description: "Found chunk with a shard key pattern violation",
details: {
namespace: "test.authors",
collectionUUID : new UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4"),
chunk: {
_id: ObjectId("64ddd81656be208c6685da1b"),
uuid: new UUID("de934e0a-74d2-412b-9bb8-409abe9754e3"),
min: {
y: 0
},
max: {
x: MaxKey
},
shard: "shard0000",
lastmod: Timestamp(1, 0),
onCurrentShardSince: Timestamp(1, 0),
history: [
{
validAfter: Timestamp(1, 0),
shard: "shard0000"
}
]
},
shardKeyPattern: {
x: 1
}
}
}
],
},
ok: 1
}