[SERVER-57102] Fixing invariants on ShardServerCatalogCacheLoader to consider different terms Created: 20/May/21  Updated: 29/Oct/23  Resolved: 25/May/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.0.25, 4.2.15, 4.4.7, 5.0.0-rc1, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Antonio Fuschetto Assignee: Antonio Fuschetto
Resolution: Fixed Votes: 0
Labels: None
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:
v5.0, v4.4, v4.2, v4.0
Sprint: Sharding EMEA 2021-05-31
Participants:

 Description   

These two invariants of the ShardServerCatalogCacheLoader verify that the ChunkVersions of the last task is contiguous to the ChunkVersions of the new task. However these invariants are incomplete: they do not properly cover scenarios in which there are stepdowns/stepups.

Note that when a new node is elected as primary it bumps its term. This is important because it changes how the minQueryVersion is computed: instead of looking at the in-memory list of tasks associated with the previous term (i.e., last time this node was primary) we end up taking as minQueryVersion whatever version is persisted on config.cache.chunks. However, when we add this new task to the list, the implementation does not consider the terms and ends up comparing versions that are not contiguous: the maxQueryVersion of the last task is different than the minQueryVersion of the new task.

The proposed solution is to avoid comparing tasks of different terms.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 28/May/21 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-57102 Fixing invariants on ShardServerCatalogCacheLoader to consider different terms
Branch: v4.4
https://github.com/mongodb/mongo/commit/a6d55fca3a30a7f41e78904a4a851f1bd6ed8d02

Comment by Githook User [ 28/May/21 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-57102 Fixing invariants on ShardServerCatalogCacheLoader to consider different terms
Branch: v4.0
https://github.com/mongodb/mongo/commit/b0a976653a626bb469754e658c978635fae87c8a

Comment by Githook User [ 28/May/21 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-57102 Fixing invariants on ShardServerCatalogCacheLoader to consider different terms
Branch: v4.2
https://github.com/mongodb/mongo/commit/84f7b6bfd558d61d6fa137f723c15d086d38157c

Comment by Githook User [ 28/May/21 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-57102 Fixing invariants on ShardServerCatalogCacheLoader to consider different terms
Branch: v5.0
https://github.com/mongodb/mongo/commit/bff57b9b502c98b0d650c46e0a82f5f9c06e71bc

Comment by Githook User [ 25/May/21 ]

Author:

{'name': 'Antonio Fuschetto', 'email': 'antonio.fuschetto@mongodb.com', 'username': 'afuschetto'}

Message: SERVER-57102 Fixing invariants on ShardServerCatalogCacheLoader to consider different terms
Branch: master
https://github.com/mongodb/mongo/commit/ccf49333014283cf0d339c92f5af9afa74d6d362

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