Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-62524

Represent FCV values meaningfully to remove dependency of utility functions on template file

    XMLWordPrintableJSON

Details

    • Replication

    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.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-repl Backlog - Replication Team
              vishnu.kaushik@mongodb.com Vishnu Kaushik
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: