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

Add support failovers in resmoke.py's ReplicaSetFixture

    XMLWordPrintable

    Details

      Description

      The ReplicaSetFixture in resmoke.py configures the replica set such that the first node is always the primary by making all other nodes have a priority of zero. In order to meaningfully support failovers, the ReplicaSetFixture class should be changed to have an option where all nodes are electable.

      • An all_nodes_electable parameter should be added to the ReplicaSetFixture constructor. The parameter should default to false in order to avoid needing to change any existing usages of the ReplicaSetFixture class by other test suites.
      • Change JSTestCase#configure() and JSONSchemaTestCase#configure() to use a MongoDB connection URI rather than using the ReplicaSetFixture#port attribute and the --port option to the mongo shell. Note: This behavior may be implemented under SERVER-19541.
      • Update ReplicaSetFixture#get_primary() to take an optional timeout parameter. The implementation should be changed to do a round of "isMaster" requests and wait until a primary becomes available or the specified period has expired. A ServerFailure exception should be raised if none of the nodes report being the primary.
      • Update ReplicaSetFixture#setup() to explicitly use ReplicaSetFixture#nodes[0] since the first node is initiated in a replica set by itself so the other nodes are able to transition to the SECONDARY state more quickly.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yves.duhem Yves Duhem
              Reporter:
              max.hirschhorn Max Hirschhorn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: