You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/02/12 17:38:38 UTC
git commit: Don't exchange schema between nodes with different
versions
Updated Branches:
refs/heads/cassandra-1.2 00a8b1e6e -> b2dfaed31
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/cassandra-1.2
Commit: b2dfaed3170c8b5b96a7ea8e7df6129490ead3be
Parents: 00a8b1e
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Feb 12 19:37:34 2014 +0300
Committer: Aleksey Yeschenko <al...@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;
}