reshardCollection 事件
摘要
reshardCollection
新功能版本中6.1: (也适用于6.0.14版本)
当以下条件满足时,将发生
reshardCollection
事件:集合的分片键和数据分布发生更改,并且
更改流具有showExpandedEvents 设置为
true
。
描述
字段 | 类型 | 描述 | |||
---|---|---|---|---|---|
_id | 文档 | 一个作为更改流事件标识符的 BSON 对象。该值用作恢复更改流时
数据类型 有关通过 | |||
clusterTime | 时间戳 |
由于 oplog 大小限制,多文档事务可能会创建多个 oplog 条目。在事务中,给定 oplog 条目中排练的更改流事件共享相同的 具有相同 要识别单个事务的事件,您可以在更改流事件文档中使用 更改版本中8.0. | |||
collectionUUID | UUID | UUID 识别发生更改的集合。 新功能版本中6.0. | |||
ns | 文档 | 受事件影响的作用域(数据库和/或集合)。 | |||
ns.coll | 字符串 | 事件发生的集合名称。 | |||
ns.db | 字符串 | 事件发生的数据库名称。 | |||
operationDescription | 文档 | ||||
operationDescription. reshardUUID | UUID | UUID 识别重新分片操作。 新功能版本中6.1. | |||
operationDescription. | shardKey | 文档 | 发生更改的集合的 分片键。 新功能版本中6.0. | |||
operationDescription. | oldShardKey | 文档 | 已更改的集合的 分片键。 新功能版本中6.1. | |||
operationDescription. | unique | 布尔值 | 如果集合使用唯一分片键进行分片,则此值为 true。 新功能版本中6.0. | |||
operationDescription. | numInitialChunks | NumberLong | 在 新功能版本中6.0. | |||
operationDescription. collation | 文档 | 校对 文档用于分片键索引。 新功能版本中6.1. | |||
operationDescription. zones | 数组 | 为新的分片键添加的区域。 新功能版本中6.1. |
示例
以下示例展示了 reshardCollection
事件
{ "_id": { <ResumeToken> }, "operationType": "reshardCollection", "collectionUUID": 0, "ns": {"db": "reshard_collection_event", "coll": "coll"}, "operationDescription": { "reshardUUID": 0, "shardKey": {"newKey": 1}, "oldShardKey": {"_id": 1}, "unique": false, "numInitialChunks": NumberLong(1), "collation": {"locale": "simple"}, "zones": [ {"zone": "zone1", "min": {"newKey": {"$minKey": 1}}, "max": {"newKey": {"$maxKey": 1}}} ] } }