[SERVER-47744] Include alwayUpsert: false in applyOps commands in sharding_catalog_manager_chunk_operations.cpp Created: 24/Apr/20 Updated: 29/Oct/23 Resolved: 29/Apr/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Cheahuychou Mao | Assignee: | Cheahuychou Mao |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | Sharding 2020-05-04 | ||||||||
| Participants: | |||||||||
| Description |
|
Currently, the applyOps command for chunk operations doesn't include the optional alwaysUpsert field. It turns out that this field defaults to true inside the applyOps command, and that the "b" field for each individual operation can be overwritten by it. So if the oplog entry has an incorrect "o2" query field, we can end up trying to insert a new chunk doc instead of updating the existing doc in which case the chunk operation will fail with DuplicateKey error (see this test). |
| Comments |
| Comment by Githook User [ 29/Apr/20 ] |
|
Author: {'name': 'Cheahuychou Mao', 'email': 'cheahuychou.mao@mongodb.com', 'username': 'cheahuychou'}Message: |