Prevent repair when protocol version does not match patch by yukim; reviewed by jbellis for CASSANDRA-5523
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/fbc4bbce Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/fbc4bbce Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/fbc4bbce Branch: refs/heads/trunk Commit: fbc4bbcecf9e2a9b6f305031bb3086dd11fbc509 Parents: 4f5c847 Author: Yuki Morishita <yu...@apache.org> Authored: Tue Apr 30 14:27:34 2013 -0500 Committer: Yuki Morishita <yu...@apache.org> Committed: Tue Apr 30 14:27:34 2013 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/service/AntiEntropyService.java | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbc4bbce/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 3922cb3..93198f0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,6 +14,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 http://git-wip-us.apache.org/repos/asf/cassandra/blob/fbc4bbce/src/java/org/apache/cassandra/service/AntiEntropyService.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/AntiEntropyService.java b/src/java/org/apache/cassandra/service/AntiEntropyService.java index eafab67..f41089e 100644 --- a/src/java/org/apache/cassandra/service/AntiEntropyService.java +++ b/src/java/org/apache/cassandra/service/AntiEntropyService.java @@ -668,10 +668,13 @@ public class AntiEntropyService throw new IOException(message); } - if (MessagingService.instance().getVersion(endpoint) < MessagingService.VERSION_11 && isSequential) + // All endpoints should be on the same protocol version + if (!MessagingService.instance().knowsVersion(endpoint) || MessagingService.instance().getVersion(endpoint) != MessagingService.current_version) { - logger.info(String.format("[repair #%s] Cannot repair using snapshots as node %s is pre-1.1", getName(), endpoint)); - return; + String message = "Cannot repair among different protocol versions"; + differencingDone.signalAll(); + logger.error(String.format("[repair #%s] ", getName()) + message); + throw new IOException(message); } }