This is an automated email from the ASF dual-hosted git repository.

jmckenzie pushed a commit to branch cassandra-4.0
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
     new ac25d6929e Better handle null state in Gossip schema migration to 
avoid NPE
ac25d6929e is described below

commit ac25d6929e182af772741c7bc2bda38d03ca4b0f
Author: Josh McKenzie <jmcken...@apache.org>
AuthorDate: Tue Sep 6 15:43:38 2022 -0400

    Better handle null state in Gossip schema migration to avoid NPE
    
    Patch by Marcus Eriksson; reviewed by Josh McKenzie and Alex Petrov for 
CASSANDRA-17864
    
    Co-authored-by: Marcus Eriksson <marc...@apache.org>
    Co-authored-by: Josh McKenzie <jmcken...@apache.org>
---
 CHANGES.txt                                                    | 1 +
 src/java/org/apache/cassandra/schema/MigrationCoordinator.java | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 3f89848d15..27d89bbd3a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0.7
+ * Better handle null state in Gossip schema migration to avoid NPE 
(CASSANDRA-17864)
  * HintedHandoffAddRemoveNodesTest now accounts for the fact that 
StorageMetrics.totalHints is not updated synchronously w/ writes 
(CASSANDRA-16679)
  * Avoid getting hanging repairs due to repair message timeouts 
(CASSANDRA-17613)
  * Prevent infinite loop in repair coordinator on FailSession (CASSANDRA-17834)
diff --git a/src/java/org/apache/cassandra/schema/MigrationCoordinator.java 
b/src/java/org/apache/cassandra/schema/MigrationCoordinator.java
index bf3aee70fc..e04f828574 100644
--- a/src/java/org/apache/cassandra/schema/MigrationCoordinator.java
+++ b/src/java/org/apache/cassandra/schema/MigrationCoordinator.java
@@ -53,6 +53,7 @@ import org.apache.cassandra.gms.ApplicationState;
 import org.apache.cassandra.gms.EndpointState;
 import org.apache.cassandra.gms.FailureDetector;
 import org.apache.cassandra.gms.Gossiper;
+import org.apache.cassandra.gms.VersionedValue;
 import org.apache.cassandra.locator.InetAddressAndPort;
 import org.apache.cassandra.net.Message;
 import org.apache.cassandra.net.MessagingService;
@@ -286,7 +287,10 @@ public class MigrationCoordinator
         if (state == null)
             return false;
 
-        final String releaseVersion = 
state.getApplicationState(ApplicationState.RELEASE_VERSION).value;
+        VersionedValue releaseVersionValue = 
state.getApplicationState(ApplicationState.RELEASE_VERSION);
+        if (releaseVersionValue == null)
+            return false;
+        final String releaseVersion = releaseVersionValue.value;
         final String ourMajorVersion = FBUtilities.getReleaseVersionMajor();
 
         if (!releaseVersion.startsWith(ourMajorVersion))


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to