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

缺失的本地集合

本页

  • 描述
  • 格式
  • 示例
MissingLocalCollection

在分片目录中注册了集合,但在相应的分片上不存在。

版本8.0.

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

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

字段
类型
描述
类型
字符串

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

描述
字符串

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

详细信息
文档

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

details.namespace
字符串

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

details.uuid
UUID

UUID 表示在分片目录上注册的集合。

details.shard
字符串

存在不一致的分片。

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

db.adminCommand( { checkMetadataConsistency: 1 } )

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

{
cursor: {
id: Long("0"),
ns: "test.$cmd.aggregate",
firstBatch: [
{
type: "MissingLocalCollection",
description: "Collection registered on the sharding catalog not found on the given shards",
details: {
namespace: "test.authors",
uuid: UUID("1ad56770-61e2-48e9-83c6-8ecefe73cfc4"),
shard: "shard02"
}
}
],
},
ok: 1
}

返回

位置错误的集合