[SERVER-43229] Merge chunk can fail if config failover just after metadata committed on primary config Created: 09/Sep/19  Updated: 29/Oct/23  Resolved: 24/Sep/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Janna Golden Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: sharding-csrs-stepdown-only, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0
Sprint: Sharding 2019-10-07
Participants:
Linked BF Score: 8

 Description   

The mergeChunk command will fail if there is a config failover just after _configsvrCommitChunkMerge finishes and the new primary does not have the updated metadata in its majority committed snapshot. The following is the scenario in which this happens:

1. Shard is running mergeChunk, sends _configsvrCommitChunkMerge to the config server.
2. Config server completes _configsvrCommitChunkMerge and updates its local metadata.
3. Config server primary steps down immediately.
4. Shard gets response from config server and flushes its filtering metadata before checking the response form the config. This will refresh from the new config primary, which does not have the updated metadata in its majority snapshot yet.
5. Shard gets a write concern error from the config.
6. The command is retried. The will resend _configsvrCommitMergeChunk to the new primary with the old chunks to be merged.
7. The new primary now has the updated metadata in its majority commit snapshot, so will fail to find the chunks to be merged and fail the command .



 Comments   
Comment by Githook User [ 24/Sep/19 ]

Author:

{'username': 'jannaerin', 'email': 'janna.golden@mongodb.com', 'name': 'Janna Golden'}

Message: SERVER-43229 Check if config metadata has merged chunk already before checking for each chunk boundary
Branch: master
https://github.com/mongodb/mongo/commit/186c4c38ad72cd33b71ff4807f15fec1e35d1db5

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