Updated Branches: refs/heads/trunk 5cf381f57 -> f5b3515ee
Don't exchange schema between nodes with different versions patch by Aleksey Yeschenko; reviewed by Piotr KoÅaczkowski for CASSANDRA-6695 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b2dfaed3 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b2dfaed3 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b2dfaed3 Branch: refs/heads/trunk Commit: b2dfaed3170c8b5b96a7ea8e7df6129490ead3be Parents: 00a8b1e Author: Aleksey Yeschenko <alek...@apache.org> Authored: Wed Feb 12 19:37:34 2014 +0300 Committer: Aleksey Yeschenko <alek...@apache.org> Committed: Wed Feb 12 19:37:34 2014 +0300 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../cassandra/service/MigrationManager.java | 20 ++++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2dfaed3/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 0674dde..de7c307 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,6 +5,7 @@ * Fix mean cells and mean row size per sstable calculations (CASSANDRA-6667) * Compact hints after partial replay to clean out tombstones (CASSANDRA-6666) * Log USING TTL/TIMESTAMP in a counter update warning (CASSANDRA-6649) + * Don't exchange schema between nodes with different versions (CASSANDRA-6695) 1.2.15 http://git-wip-us.apache.org/repos/asf/cassandra/blob/b2dfaed3/src/java/org/apache/cassandra/service/MigrationManager.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/service/MigrationManager.java b/src/java/org/apache/cassandra/service/MigrationManager.java index 5a02e3b..68d0bad 100644 --- a/src/java/org/apache/cassandra/service/MigrationManager.java +++ b/src/java/org/apache/cassandra/service/MigrationManager.java @@ -134,13 +134,11 @@ public class MigrationManager private static boolean shouldPullSchemaFrom(InetAddress endpoint) { /* - * Don't request schema from nodes with versions younger than 1.1.7 (timestamps in versions prior to 1.1.7 are broken) - * Don't request schema from nodes with a higher major (may have incompatible schema) + * Don't request schema from nodes with a differnt or unknonw major version (may have incompatible schema) * Don't request schema from fat clients */ return MessagingService.instance().knowsVersion(endpoint) - && MessagingService.instance().getVersion(endpoint) >= MessagingService.VERSION_117 - && MessagingService.instance().getVersion(endpoint) <= MessagingService.current_version + && MessagingService.instance().getVersion(endpoint) == MessagingService.current_version && !Gossiper.instance.isFatClient(endpoint); } @@ -291,15 +289,13 @@ public class MigrationManager for (InetAddress endpoint : Gossiper.instance.getLiveMembers()) { - if (endpoint.equals(FBUtilities.getBroadcastAddress())) - continue; // we've dealt with localhost already - - // don't send schema to the nodes with the versions older than current major - if (MessagingService.instance().getVersion(endpoint) < MessagingService.current_version) - continue; - - pushSchemaMutation(endpoint, schema); + // only push schema to nodes with known and equal versions + if (!endpoint.equals(FBUtilities.getBroadcastAddress()) && + MessagingService.instance().knowsVersion(endpoint) && + MessagingService.instance().getVersion(endpoint) == MessagingService.current_version) + pushSchemaMutation(endpoint, schema); } + return f; }