cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jji...@apache.org
Subject [1/6] cassandra git commit: Write schema tables with timestamp=0 to avoid excess schema migrations
Date Mon, 24 Apr 2017 16:13:08 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 d079ce015 -> 032a8cc1e
  refs/heads/cassandra-3.11 44eb797ad -> 1a37992e9
  refs/heads/trunk 87169c82f -> 1e20d9513


Write schema tables with timestamp=0 to avoid excess schema migrations

Patch by Jeff Jirsa; Reviewed by Aleksey Yeschenko for CASSANDRA-13441


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

Branch: refs/heads/cassandra-3.0
Commit: 032a8cc1e9424c718a78e1463530d62e2e310d4a
Parents: d079ce0
Author: Jeff Jirsa <jjirsa@apple.com>
Authored: Mon Apr 17 22:02:38 2017 -0700
Committer: Jeff Jirsa <jeff@jeffjirsa.net>
Committed: Mon Apr 24 09:10:02 2017 -0700

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 src/java/org/apache/cassandra/service/MigrationManager.java | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/032a8cc1/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7a860fe..19cd39c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,6 +4,7 @@
  * Avoid name clashes in CassandraIndexTest (CASSANDRA-13427)
  * Handling partially written hint files (CASSANDRA-12728) 
  * Interrupt replaying hints on decommission (CASSANDRA-13308)
+ * Fix schema version calculation for rolling upgrades (CASSANDRA-13441)
 
 3.0.13
  * Make reading of range tombstones more reliable (CASSANDRA-12811)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/032a8cc1/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 7c929e7..aacb769 100644
--- a/src/java/org/apache/cassandra/service/MigrationManager.java
+++ b/src/java/org/apache/cassandra/service/MigrationManager.java
@@ -325,11 +325,16 @@ public class MigrationManager
      */
     public static void forceAnnounceNewColumnFamily(CFMetaData cfm) throws ConfigurationException
     {
-        announceNewColumnFamily(cfm, false, false);
+        announceNewColumnFamily(cfm, false, false, 0);
     }
 
     private static void announceNewColumnFamily(CFMetaData cfm, boolean announceLocally,
boolean throwOnDuplicate) throws ConfigurationException
     {
+        announceNewColumnFamily(cfm, announceLocally, throwOnDuplicate, FBUtilities.timestampMicros());
+    }
+
+    private static void announceNewColumnFamily(CFMetaData cfm, boolean announceLocally,
boolean throwOnDuplicate, long timestamp) throws ConfigurationException
+    {
         cfm.validate();
 
         KeyspaceMetadata ksm = Schema.instance.getKSMetaData(cfm.ksName);
@@ -340,7 +345,7 @@ public class MigrationManager
             throw new AlreadyExistsException(cfm.ksName, cfm.cfName);
 
         logger.info(String.format("Create new table: %s", cfm));
-        announce(SchemaKeyspace.makeCreateTableMutation(ksm, cfm, FBUtilities.timestampMicros()),
announceLocally);
+        announce(SchemaKeyspace.makeCreateTableMutation(ksm, cfm, timestamp), announceLocally);
     }
 
     public static void announceNewView(ViewDefinition view, boolean announceLocally) throws
ConfigurationException


Mime
View raw message