文档菜单
文档首页
/
MongoDB 手册
/ / /

损坏的块分片键

本页内容

  • 描述
  • 格式
  • 示例
CorruptedChunkShardKey

路由表包含一个具有最小键或最大键的块,该键与集合分片键不对应。

版本7.0.

{
type: "CorruptedChunkShardKey",
description: "<string>",
details: {
namespace: "<string>",
collectionUUID: UUID("<uuid>"),
chunk: <chunk>,
shardKeyPattern: <pattern>
}
}

CorruptedChunkShardKey 不一致性文档包含以下字段

字段
类型
描述
类型
字符串

不一致性文档的类型。对于此不一致性类型,返回 CorruptedChunkShardKey 的值。

描述
字符串

描述在元数据中找到的不一致性。

详细信息
文档

包含有关不一致性存在于数据库和分片集群中的额外信息的文档。

详细信息命名空间
字符串

指示不一致性存在的数据库和集合。

详细信息集合UUID
UUID
损坏的块分片键的集合的 UUID。
详细信息块
文档
具有损坏的分片键的块。
详细信息分片键模式
文档

集合分片键模式。

使用db.adminCommand() 方法调用 checkMetadataConsistency 命令

db.adminCommand( { checkMetadataConsistency: 1 } )

此方法返回一个游标,其中包含一个批次的文档,显示在分片元数据中找到的不一致性。下面的示例显示了包含 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
}

返回

集合UUID不匹配

本页内容