[SERVER-48990] Introduce ComparableChunkVersion class Created: 19/Jun/20  Updated: 29/Oct/23  Resolved: 12/Aug/20

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

Type: Task Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Marcos José Grillo Ramirez
Resolution: Fixed Votes: 0
Labels: PM-1645-Milestone-2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-46199 Implement collection cache on top of ... Closed
Related
related to SERVER-50285 Complete TODO listed in SERVER-48990 Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

ChunkVersion consists of: <epoch, majorVersion, minorVersion>. The epoch is an ObjectId, which poses a problem for using it directly in the CatalogCache, because it is not comparable.

In order to make it comparable, we will need to utilise the configOpTime as a way to discern which epoch is the most recent one. As a context, when we go against the config server to retrieve the changed chunks, we use an {afterOpTime: <configOpTime>} as a way to ensure causal consistency with any previous writes. The response itself comes with the latest committed/visible opTime on the config server.

The proposal is to introduce a new class called say ComparableChunkVersion, which incorporates the latest visible opTime at the time a given ChunkVersion was obtained from the config server and in the case there is difference between the epochs, use the visibleOpTime as a tie-breaker to decide which epoch to use.

Due to the time at which the committed/visible opTime is attached to the response by the config server, it is possible that two ComparableChunkVersions contain different epochs E1 and E2, but the same visibleOpTime, in which case we can’t use a tie-breaker. In this case, the router will have to do a write against the config server in order to bump the visible opTime and redo the read.



 Comments   
Comment by Githook User [ 12/Aug/20 ]

Author:

{'name': 'Marcos José Grillo Ramírez', 'email': 'marcos.grillo@mongodb.com', 'username': 'm4nti5'}

Message: SERVER-48990 Added comparable chunk version as a prerequisite to implement a causally consistent collection cache
Branch: master
https://github.com/mongodb/mongo/commit/741bbb63dc64f3ed4bc65883f5fd05fabbea6409

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