tolbertam commented on code in PR #4558:
URL: https://github.com/apache/cassandra/pull/4558#discussion_r2836601637


##########
src/java/org/apache/cassandra/repair/autorepair/AutoRepairUtils.java:
##########
@@ -451,6 +451,42 @@ public static boolean hasMultipleLiveMajorVersions()
         return majorVersions.size() > 1;
     }
 
+    /**
+     * Last version that does not support auto-repair.
+     * All nodes in the cluster must be running a version above this to enable 
auto-repair.
+     * Versions at or below this version (5.0.6) do not support auto-repair.
+     */
+    @VisibleForTesting
+    static final CassandraVersion LAST_UNSUPPORTED_VERSION_FOR_AUTO_REPAIR = 
new CassandraVersion("5.0.6");
+
+    /**
+     * Checks whether any node in the cluster is running an unsupported 
version for auto-repair.
+     *
+     * @return true if any live node has a version at or below 5.0.6 
(unsupported) or has an unknown version,
+     *         false if all nodes are running versions above 5.0.6 (supported)
+     */
+    public static boolean hasNodesBelowMinimumVersion()
+    {
+        Set<InetAddressAndPort> liveEndpoints = 
Gossiper.instance.getLiveMembers();
+        for (InetAddressAndPort endpoint : liveEndpoints)
+        {
+            CassandraVersion releaseVersion = 
Gossiper.instance.getReleaseVersion(endpoint);
+            if (releaseVersion == null)
+            {
+                logger.warn("Cannot determine version for endpoint {}, 
blocking auto-repair", endpoint);
+                return true;
+            }

Review Comment:
   That said with how unpredictable gossip state may be, it could be useful to 
have some kind of override (system property?) to bypass this logic, in the 
event that this does become problematic.  Once a cluster is fully converged on 
5.0.7, this should not be a concern any more and would not want AutoRepair to 
be bypassed on a node because of some messed up gossip state.



-- 
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