[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:
Related
related to SERVER-47745 Make chunk query in ShardingCatalogMa... Closed
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: SERVER-47744 Include alwayUpsert: false in applyOps commands in sharding_catalog_manager_chunk_operations.cpp
Branch: master
https://github.com/mongodb/mongo/commit/40b52e8fa87324265293da6614ccb73551b42529

Generated at Thu Feb 08 05:15:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.