Github user jolynch commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/212#discussion_r228386194
  
    --- Diff: 
src/java/org/apache/cassandra/net/StartupClusterConnectivityChecker.java ---
    @@ -73,56 +80,84 @@ public static StartupClusterConnectivityChecker 
create(int targetPercent, int ti
          * @return true if the requested percentage of peers are marked ALIVE 
in gossip and have their connections opened;
          * else false.
          */
    -    public boolean execute(Set<InetAddressAndPort> peers)
    +    public boolean execute(Set<InetAddressAndPort> peers, 
Function<InetAddressAndPort, String> getDatacenter)
         {
    -        if (targetPercent == 0 || peers == null)
    +        if (peers == null)
                 return true;
     
             // make a copy of the set, to avoid mucking with the input (in 
case it's a sensitive collection)
             peers = new HashSet<>(peers);
    -        peers.remove(FBUtilities.getBroadcastAddressAndPort());
    -
    -        if (peers.isEmpty())
    +        InetAddressAndPort localAddress = 
FBUtilities.getBroadcastAddressAndPort();
    +        if (peers.size() == 1 && peers.contains(localAddress))
                 return true;
     
    -        logger.info("choosing to block until {}% of the {} known peers are 
marked alive and connections are established; max time to wait = {} seconds",
    -                    targetPercent, peers.size(), 
TimeUnit.NANOSECONDS.toSeconds(timeoutNanos));
    +        Set<InetAddressAndPort> myLocalPeers = peers.stream()
    +                                                    
.collect(Collectors.groupingBy(getDatacenter, toSet()))
    +                                                    
.getOrDefault(getDatacenter.apply(FBUtilities.getBroadcastAddressAndPort()),
    +                                                                  
Collections.emptySet());
    +
    +
    +        logger.info("choosing to block until no more than {}/{} local and 
no more than {}/{} global peers are still DOWN; max time to wait = {} seconds",
    --- End diff --
    
    I changed it to remove the local peer like before :-)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to