Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 127DC10810 for ; Wed, 12 Feb 2014 16:41:46 +0000 (UTC) Received: (qmail 55822 invoked by uid 500); 12 Feb 2014 16:41:44 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 55764 invoked by uid 500); 12 Feb 2014 16:41:44 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 55747 invoked by uid 99); 12 Feb 2014 16:41:43 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Feb 2014 16:41:43 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A227E8263E5; Wed, 12 Feb 2014 16:41:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: aleksey@apache.org To: commits@cassandra.apache.org Date: Wed, 12 Feb 2014 16:41:43 -0000 Message-Id: <7f30b26a063a41ba863df768871723ab@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: Don't exchange schema between nodes with different versions 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 Authored: Wed Feb 12 19:37:34 2014 +0300 Committer: Aleksey Yeschenko 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; }