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

Prevent comparison of member indexes from different config versions

    XMLWordPrintable

    Details

      Description

      SERVER-46667 and other bugs are the result of comparing member indexes from different replica set configs, or using a member index from one config as an array index in a different config.

      Devise a way to avoid repeating these sorts of bugs. Two ideas:

      1. Minimize all use of member indexes from configs, ReplSetMetadata, OplogQueryMetadata, etc. Try to find alternative means of accomplishing the same goals.
      2. Anywhere that member indexes are compared, include the config version and term. Perhaps create a MemberIndex class that has an index, version, and term. Two MemberIndexes cannot be compared unless their versions and terms agree. The name MemberIndex may be too similar to MemberId, so let's ponder the name.
      3. Hide member indexes behind safe interfaces. E.g., instead of using OplogQueryMetadata.getSyncSourceIndex() directly, create safer methods like hasSyncSourceIndex() or isSameSyncSourceIndex(MemberIndex i).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-repl Backlog - Replication Team
              Reporter:
              jesse A. Jesse Jiryu Davis
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: