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

FeatureCompatibility Version enum is redundant with public methods

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc2
    • Component/s: Sharding
    • Labels:
      None
    • Backwards Compatibility:
      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

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: