CorruptedChunkShardKey
说明
format
{ type: "CorruptedChunkShardKey", description: "<string>", details: { namespace: "<string>", collectionUUID: UUID("<uuid>"), chunk: <chunk>, shardKeyPattern: <pattern> } }
CorruptedChunkShardKey
不一致文档包含以下字段:
字段 | 类型 | 说明 |
---|---|---|
| 字符串 | 不一致文档的类型。 为此不一致类型返回值 |
| 字符串 | 描述在元数据中发现的不一致之处。 |
| 文档 | 包含有关数据库和分片集群中哪些位置存在不一致的附加信息的文档。 |
| 字符串 | 指示存在不一致的数据库和collection。 |
| UUID | 具有损坏数据块分片键的collection的 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 }