[SERVER-53274] The force-write of the `history` field to all chunks on FCV upgrade from 3.6 to 4.0 is unnecessary Created: 08/Dec/20  Updated: 29/Oct/23  Resolved: 05/Feb/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 4.0.21
Fix Version/s: 4.0.23

Type: Task Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 6
Labels: Sharding-EMEA, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-56795 Changes from SERVER-53274 were uninte... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-01-11, Sharding 2021-02-08
Participants:
Case:

 Description   

With the (partial) introduction of the readAtCluster time feature in version 4.0, we introduced the history field to entries in config.chunks. The FCV upgrade step from 3.6 to 4.0 forcefully writes the history field to all chunks in the system and bumps their version in order for the cache to be able to see the change.

This however, causes problems on upgrades, because it causes a total throw-out of the caches and also full rewrite of the local cache collections on the Shards, which in the case of many chunks can cause minutes of stall. These stalls on top of that are unpredictable and might not be related when the FCV command was run.

I am fairly certain that we can throw out the force-write of the history field and leave them to happen lazily. The code even in master is prepared to handle the missing field.

On downgrades I think it is also safe to not bother removing it. Older code will ignore it and if another upgrade is performed, there is no harm with having the values there, because they will map to a very old cluster time which will be smaller than the current one, so no harm.



 Comments   
Comment by Githook User [ 11/May/21 ]

Author:

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

Message: SERVER-56795 Changes from SERVER-53274 were unintentionally reverted
Branch: v4.0
https://github.com/mongodb/mongo/commit/70299e858e3f54c01fdb96cdd1c430972500b97f

Comment by Githook User [ 05/Feb/21 ]

Author:

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

Message: SERVER-53274 Avoid bumping all chunk versions after writing 'history' field on FCV upgrade to 4.0.

Instead, bump only one chunk per shard to satisfy the reqirements
imposed by SERVER-33356
Branch: v4.0
https://github.com/mongodb/mongo/commit/52d6f11c459b8d3666379431a6accf7fef4e852f

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