[SERVER-56399] Configsvr step-up can fail after stepping-down during setFCV metadata patch-up Created: 27/Apr/21  Updated: 29/Oct/23  Resolved: 29/Apr/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: PM-1965-Milestone-0-Metadata-Format
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Provided that featureFlagShardingFullDDLSupportTimestampedVersion is enabled, consider the following situation:
1. Configsvr starts fcv upgrade 4.4 -> 5.0. Thus, persists kUpgradingFrom44To50 fcv value.
2. Metadata patchup for phase-1 completes: This means that chunks now have uuid, we have build the uuid_1_* indexes and dropped the ns_1_* indexes for config.chunks.
3. Metadata patchup for phase-2 is in progress. We have (partially or completely) $unset the ns from the chunks.
4. Before transitioning to fcv kVersion50, the configsvr steps down
5. The new configsvr primary steps up, ShardingCatalogManager::initializeConfigDatabaseIfNeeded is called, which will call ShardingCatalogManager::_initConfigIndexes. Because the current fcv value is kUpgradingFrom44To50, it will create the indexes for ns_1_*, but he have already $unset the 'ns' fields from the config.chunks, so it will fail due to DuplicateKey errors.



 Comments   
Comment by Githook User [ 29/Apr/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-56399 Configsvr step-up can fail after stepping-down during setFCV metadata patch-up
Branch: master
https://github.com/mongodb/mongo/commit/731864699b5e71e57ea6bf27a38670ccfebab652

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