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

FeatureCompatibility Version enum is redundant with public methods

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.6.0-rc2
    • Sharding
    • None
    • Fully Compatible

    Description

      The methods just check specific values for the enum. We should either make the enum definition private or remove the functions.

      ------

      Make the class behave like this:

          struct FeatureCompatibility {
              enum class Version { kFullyDowngradedTo34, kUpgradingTo36, kFullyUpgradedTo36, kDowngradingTo34, kUnsetIn36 };
       
              const Version getVersion() const {
                  return _version.load();
              }
       
              void reset() {
                  _version.store(Version::k34);
              }
       
              void setVersion(Version version) {
                  // enforce state transitions
                  return _version.store(version);
              }
       
              const bool isSchemaVersion36() {
                  return (isFullyUpgradedTo36() || isUpgradingTo36());
              }
       
          private:
              AtomicWord<Version> _version{Version::kUnset};
       
          } featureCompatibility;
      

      Attachments

        Issue Links

          Activity

            People

              judah.schvimer@mongodb.com Judah Schvimer
              judah.schvimer@mongodb.com Judah Schvimer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: