-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
Fully Compatible
-
ALL
-
v8.0
-
CAR Team 2024-07-22
-
200
if there is a unique index on field other than _id.
This is because the resharding oplog batch applier partitions a batch of oplog to apply by _id of the document to each worker thread. This creates a scenario where ops are executed on a different order compared to the source collection, potentially introducing a uniqueness violation that never occurred in the source collection.
Some examples (unique on field x):
op0: insert _id: 1, x: 1
op1: delete _id: 1
op2: insert _id: 2, x: 1
Example order that cauases a uniquness violation: op0 -> op2 -> op1
Another example (unique on field x):
op0: insert _id: 1, x: 1
op1: insert _id: 2, x: 2
op2: update _id: 2, set x = 3
op3: update _id: 1, set x = 2
Example order that causes a uniquness violation: op0 -> op1 -> op3 -> op2
Note: This ticket introduced the paramter 'oplogBatchApplierTaskCount' in moveCollection and unshardCollection. A user can set this parameter to 1 to avoid any duplicate key error.
SERVER-85275 is required to make reshardCollection resilient to the error where it auto-corrects by setting oplogBatchApplierTaskCount to 1 instead of aborting the operation. SERVER-85275 also needs to introduce this parameter in reshardCollection because it was only added in the internal call of reshardCollection in this ticket.
- is depended on by
-
SERVER-90646 Re-enable background_unique_indexes.js in config transition suites
-
- Backlog
-
- is duplicated by
-
SERVER-92043 Add reshardingOplogBatchTaskCount as a command parameter to reshardCollection, moveCollection and unshardCollection
-
- Closed
-
- is related to
-
SERVER-85275 Resharding oplog application should ignore DuplicateKey error by autocorrecting by setting oplogBatchApplierTaskCount to 1 instead of aborting the operation
-
- Backlog
-
- related to
-
SERVER-92043 Add reshardingOplogBatchTaskCount as a command parameter to reshardCollection, moveCollection and unshardCollection
-
- Closed
-