You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by aw...@apache.org on 2018/12/13 18:24:03 UTC

[09/10] cassandra git commit: Merge branch '14928-3.0' into 14928-3.11

Merge branch '14928-3.0' into 14928-3.11


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/27c53b52
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/27c53b52
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/27c53b52

Branch: refs/heads/trunk
Commit: 27c53b526d56bcce41e3b83b854bb4a4b0e8bf4d
Parents: 2edd6fd 1816520
Author: Ariel Weisberg <aw...@apple.com>
Authored: Thu Dec 13 12:34:13 2018 -0500
Committer: Ariel Weisberg <aw...@apple.com>
Committed: Thu Dec 13 12:34:13 2018 -0500

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../apache/cassandra/service/MigrationManager.java    | 10 ++++++++--
 src/java/org/apache/cassandra/utils/FBUtilities.java  | 14 +++++++++++++-
 3 files changed, 22 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/27c53b52/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27c53b52/src/java/org/apache/cassandra/service/MigrationManager.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/service/MigrationManager.java
index a1b3597,92d3dd5..2f71004
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@@ -77,34 -77,26 +77,40 @@@ public class MigrationManage
  
      public static void scheduleSchemaPull(InetAddress endpoint, EndpointState state)
      {
 -        VersionedValue value = state.getApplicationState(ApplicationState.SCHEMA);
 -
 -        if (!endpoint.equals(FBUtilities.getBroadcastAddress()) && value != null)
 -            maybeScheduleSchemaPull(UUID.fromString(value.value), endpoint, state.getApplicationState(ApplicationState.RELEASE_VERSION).value);
 +        UUID schemaVersion = state.getSchemaVersion();
 +        if (!endpoint.equals(FBUtilities.getBroadcastAddress()) && schemaVersion != null)
-             maybeScheduleSchemaPull(schemaVersion, endpoint);
++            maybeScheduleSchemaPull(schemaVersion, endpoint, state.getApplicationState(ApplicationState.RELEASE_VERSION).value);
      }
  
      /**
       * If versions differ this node sends request with local migration list to the endpoint
       * and expecting to receive a list of migrations to apply locally.
       */
-     private static void maybeScheduleSchemaPull(final UUID theirVersion, final InetAddress endpoint)
+     private static void maybeScheduleSchemaPull(final UUID theirVersion, final InetAddress endpoint, String  releaseVersion)
      {
+         String ourMajorVersion = FBUtilities.getReleaseVersionMajor();
+         if (!releaseVersion.startsWith(ourMajorVersion))
+         {
+             logger.debug("Not pulling schema because release version in Gossip is not major version {}, it is {}", ourMajorVersion, releaseVersion);
+             return;
+         }
 -
 -        if ((Schema.instance.getVersion() != null && Schema.instance.getVersion().equals(theirVersion)) || !shouldPullSchemaFrom(endpoint))
 +        if (Schema.instance.getVersion() == null)
 +        {
 +            logger.debug("Not pulling schema from {}, because local schama version is not known yet",
 +                         endpoint);
 +            return;
 +        }
 +        if (Schema.instance.isSameVersion(theirVersion))
 +        {
 +            logger.debug("Not pulling schema from {}, because schema versions match: " +
 +                         "local/real={}, local/compatible={}, remote={}",
 +                         endpoint,
 +                         Schema.schemaVersionToString(Schema.instance.getRealVersion()),
 +                         Schema.schemaVersionToString(Schema.instance.getAltVersion()),
 +                         Schema.schemaVersionToString(theirVersion));
 +            return;
 +        }
 +        if (!shouldPullSchemaFrom(endpoint))
          {
              logger.debug("Not pulling schema because versions match or shouldPullSchemaFrom returned false");
              return;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27c53b52/src/java/org/apache/cassandra/utils/FBUtilities.java
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org