diff --git a/CHANGES.txt b/CHANGES.txt index 5e9edfdbec..48cd54a60d 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -55,6 +55,7 @@ * Fix repair -snapshot not working (CASSANDRA-5512) * Set isRunning flag later in binary protocol server (CASSANDRA-5467) * Fix use of CQL3 functions with descencind clustering order (CASSANDRA-5472) + * Prevent repair when protocol version does not match (CASSANDRA-5523) Merged from 1.1 * Add retry mechanism to OTC for non-droppable_verbs (CASSANDRA-5393) * Use allocator information to improve memtable memory usage estimate diff --git a/src/java/org/apache/cassandra/service/ActiveRepairService.java b/src/java/org/apache/cassandra/service/ActiveRepairService.java index b692ab0c77..1752911e7e 100644 --- a/src/java/org/apache/cassandra/service/ActiveRepairService.java +++ b/src/java/org/apache/cassandra/service/ActiveRepairService.java @@ -658,6 +658,15 @@ public class ActiveRepairService logger.error(String.format("[repair #%s] ", getName()) + message); throw new IOException(message); } + + // All endpoints should be on the same protocol version + if (!MessagingService.instance().knowsVersion(endpoint) || MessagingService.instance().getVersion(endpoint) != MessagingService.current_version) + { + String message = "Cannot repair among different protocol versions"; + differencingDone.signalAll(); + logger.error(String.format("[repair #%s] ", getName()) + message); + throw new IOException(message); + } } ActiveRepairService.instance.sessions.put(getName(), this);