Comment 6 for bug 1813953

Revision history for this message
John A Meinel (jameinel) wrote :

All of them *are* in "*107*" and "*70*" and "*86*", so those should be possible values. And, in fact, they are currently configured to use the "*107*" addresses. (rs_addr=)

It sounds like the problem is either:

a) We're not properly flagging HostPorts with the right SpaceNames
b) You asked for a space that the existing HostPorts aren't in.

Note that the code that is calling this function is doing:
// SelectPeerHostPortBySpace returns the HostPort to use as the mongo replica set peer
// by selecting it from the given hostPorts.
func SelectPeerHostPortBySpace(hostPorts []network.HostPort, space network.SpaceName) string {
        // ScopeMachineLocal addresses are OK if we can't pick by space.
        suitableHostPorts, foundHostPortsInSpaces := network.SelectMongoHostPortsBySpaces(hostPorts, []network.SpaceName{space})

        if !foundHostPortsInSpaces {
                logger.Debugf("Failed to select hostPort by space - trying by scope from %+v", hostPorts)
                suitableHostPorts = network.SelectMongoHostPortsByScope(hostPorts, true)
        }
        return suitableHostPorts[0]
}

Since we didn't find "oam" by name, we fell back to selecting them by Scope, and *allowing* machineLocal addresses. (I believe we allow local addresses to handle the case where we are not in a replicaset, so we just need to connect to the mongo that is on this machine.

Note that this should all be fixed in 2.4 as we changed it to require setting a space for controllers to be in, and we validate that the spaces are available.

I believe that the bug is probably (a), but that we've fixed that in newer releases.

Is there a specific reason why they can't go to 2.4?