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

集合 UUID 不匹配

在本页

  • 描述
  • 格式
  • 示例
CollectionUUIDMismatch

存在一个集合,在分片上注册的本地UUID与在config.collections集群目录中注册的UUID不同。

版本7.0.

{
type: "CollectionUUIDMismatch",
description: "<string>",
details: {
namespace: "<string>",
shard: "<string>",
localUUID: UUID("<uuid>"),
uuid: UUID("<uuid>")
}
}

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

字段
类型
描述
类型
字符串

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

description
字符串

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

details
document

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

details.namespace
字符串

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

details.shard
字符串

存在不一致性的分片。

details.localUUID
UUID
在分片上本地注册的UUID。
details.uuid
UUID
config.collections集群目录中找到的集合的UUID。

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

db.adminCommand( { checkMetadataConsistency: 1 } )

该方法返回一个游标,其中包含显示在分片元数据中找到的不一致性的文档批次。以下示例显示了一个包含CollectionUUIDMismatch不一致性文档的游标

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "CollectionUUIIDMismatch",
description: "Found collection on non primary shard with mismatching UUID",
details: {
namespace: "test.authors",
shard: "shard02",
localUUID: new UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4"),
uuid: new UUID("a3153e8a-3544-43ec-928f-37f72b48dee9")
}
}
],
},
ok: 1
}

返回

集合选项不匹配