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

Calculate generic WireVersion enum constants

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Repl 2021-08-09, Repl 2021-08-23

      Today, the WireVersion enum is like this:

      enum WireVersion {
          RELEASE_2_4_AND_BEFORE = 0,
          ... some semantically significant wire versions ...
          // Supports resumable initial sync (4.4+).
          RESUMABLE_INITIAL_SYNC = 9,
          WIRE_VERSION_47 = 10,
          WIRE_VERSION_48 = 11,
          WIRE_VERSION_49 = 12,
          WIRE_VERSION_50 = 13,
          LATEST_WIRE_VERSION = WIRE_VERSION_50,
          LAST_CONT_WIRE_VERSION = LATEST_WIRE_VERSION - 1,
          LAST_LTS_WIRE_VERSION = RESUMABLE_INITIAL_SYNC,
      };
      

      Remove all values starting with WIRE_VERSION_47. These values are used only by class WireSpec to determine if an incoming client is compatible with this server, and to fill out the min/maxWireVersion fields of the "hello" reply.

      Instead, calculate the latest, last rapid, and last major wire versions at runtime from the generated kNumberOfReleasesSince44 constants. For example, the latest wire version is RESUMABLE_INITIAL_SYNC + kNumberOfReleasesSince44.

            Assignee:
            xuerui.fa@mongodb.com Xuerui Fa
            Reporter:
            xuerui.fa@mongodb.com Xuerui Fa
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: