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

FeatureCompatibility Version enum is redundant with public methods

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.6.0-rc2
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible

      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;
      

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

              Created:
              Updated:
              Resolved: