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

Write more test for ReplicaSetMonitor

    • Fully Compatible

      We could add more test in this description as we go along, but here's some things we should test:

      1. Test inconsistent replies for isMaster/replSetGetStatus from different nodes (simulating a condition where the config doc was not yet fully propagated to the other secondaries).
        1. Multiple nodes claim to be master. We use a last-wins policy.
        2. Nodes disagree about who is in set. We only trust replies from the master when adjusting set membership (unless no master found during scan). Make sure the final nodes list, the seeds list, and the nodes contacted during the scan are correct.
        3. Combination of the last two: Multiple nodes claim to be master and disagree about set membership.
      2. Make sure SetState::getMatchingHost returns hosts even if a scan is ongoing. This is what allows early exit from Refresher::refreshUntilMatches and allows RSM::getHost() to avoid going to the network if we know of a suitable node.
      3. Make sure nothing breaks if someone calls the out-of-band RSM::failedHost notifier during a scan.
      4. Test parsing of isMaster replies. This can directly test RSM::IsMasterReply::parse().
      5. Consider cribbing tests from other drivers if they make sense.

            Assignee:
            tyler@10gen.com Tyler Brock
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: