[SERVER-62524] Represent FCV values meaningfully to remove dependency of utility functions on template file Created: 11/Jan/22  Updated: 04/May/23

Status: Open
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Vishnu Kaushik Assignee: Backlog - Replication Team
Resolution: Unresolved Votes: 0
Labels: former-quick-wins, pm-2821-quick-wins, tech-debt-repl
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-58534 Collect FCV in FTDC Closed
Assigned Teams:
Replication
Participants:

 Description   

Currently, the releases.h.tpl template file which uses Cheetah to generate FCV enums also generates a few utility functions, such as the function to convert the enums to strings (multiversion::toString).

However, when future utility functions need to be added, say to get an FCV's major number (as in SERVER-58534), or perhaps stringify the FCV in some other way, we will be forced to generate the new utility functions via the template file.

Consequently, the template file will become big and it will be hard for future implementers since understanding Cheetah is required.

We can de-couple utility functions from the template file by creating a new FCV class to represent an FCV (containing majorVersion, minorVersion, isTransition, etc. as the attributes), and having the template file generate only a function to convert from FCV enums to an object of the FCV class.

Then, utility functions can live elsewhere in CPP code and can perform all their operations on an FCV class object. For example, toString would peek at the object and appropriately stringify it based on the attributes.

This ticket is to track that work.



 Comments   
Comment by Vishnu Kaushik [ 11/Jan/22 ]

CC: xuerui.fa

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