- 
    Type:
Improvement
 - 
    Resolution: Won't Do
 - 
    Priority:
Major - P3
 - 
    None
 - 
    Affects Version/s: None
 - 
    Component/s: Internal Code
 - 
    None
 
- 
        Service Arch
 - 
        Service Arch 2019-07-01
 - 
        None
 
- 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 
Right now the ReplicaSetMonitor::getHostsOrRefresh only returns the non-preferred option (for PrimaryPreferred and SecondaryPreferred) when the preferred options are completely untargettable.
But, after SERVER-41133, we'll be able to take advantage of  the lists of hosts returned in SERVER-41134, and we can weaken our notion of "preferred" from "is targettable" to "has a connection available"
I.e. if matchingHosts =
{ secondary1, secondary2, primary }(where 50% of the time we swap secondary 1 and secondary 2) we have the technology to select a secondary, falling back to the primary, in the order a connection becomes available. In a system with "enough" connections, that should send all traffic to secondaries, and only route to the primary when we have no connections available. I think this weakening is inline with the rest of the work in PM-856
- is related to
 - 
                    
SERVER-41133 Add TaskExecutor::scheduleRemoteCommandOnAny
-         
 - Closed
 
 -         
 - 
                    
SERVER-41134 Add RSM::findHostsWithMaxWait
-         
 - Closed
 
 -