smiklosovic commented on code in PR #3661:
URL: https://github.com/apache/cassandra/pull/3661#discussion_r1833432105


##########
src/java/org/apache/cassandra/gms/Gossiper.java:
##########
@@ -2023,10 +2018,13 @@ public List<String> reloadSeeds()
             return getSeeds();
         }
 
+        tmp.remove(getBroadcastAddressAndPort());

Review Comment:
   @dcapwell 
   
   There is this above that:
   
   ````
           if (tmp.isEmpty())
           {
               logger.trace("New seed node list is empty. Not updating seed 
list.");
               return getSeeds();
           }
   ````
   
   If we removed local address before - so `tmp` is empty - it would return 
here. But in that case `seeds` would not be changed as it would return 
prematurely - that is the reason we see this behavior described in the ticket.
   
   But we have to remove local address from `tmp` before going to mutate 
`seeds` 
   
   ````
           // Add the new entries
           seeds.addAll(tmp);
           // Remove the old entries
           seeds.retainAll(tmp);
   ````
   
   This would add nothing with `addAll` as tmp is empty and it would remove 
everything when `retainAll(empty list)`. So `seeds` would end up empty in the 
end. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to