-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Cluster Scalability
-
Fully Compatible
-
ALL
-
v8.0, v7.0, v6.0, v5.0
-
Cluster Scalability 2024-11-11
-
(copied to CRM)
ReshardCollection performs a rename with dropTarget: true during commit when it switches the temporary collection to have the name of the real collection. The oplog generated from this operation has fromMigrate: true, so the changeStreams will not include this event.
However, there is a logic in the cleanup phase to make sure the original collection doesn't exist anymore that sends drop to all shards. If the drop was not a no-op, this will generate a drop collection oplog entry without fromMigrate: true causing the change stream to pick it up and cause a invalid event type.
As a summary, all of these conditions must be present to trigger bug:
- change stream on specific namespace or database (change stream on the entire cluster doesn't produce invalidate events)
- original collection had shards that had an empty collection of the same namespace and doesn't own any chunks, both before and after resharding. If the shard would own chunks after resharding, it would have been renamed instead of dropped.
- is caused by
-
SERVER-54231 Resharding can leave behind local collection on former primary shard that doesn't own any chunks
- Closed