cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject git commit: Migrate key_alias->key_aliases on every schema migration (1.2)
Date Tue, 13 Aug 2013 18:56:09 GMT
Updated Branches:
  refs/heads/cassandra-1.2 2d2099751 -> 82081c7b4


Migrate key_alias->key_aliases on every schema migration (1.2)

Another follow-up to 5800


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

Branch: refs/heads/cassandra-1.2
Commit: 82081c7b4b2ad2d602374f0817abc4cfc2c86c98
Parents: 2d20997
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Tue Aug 13 20:52:34 2013 +0200
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue Aug 13 20:54:24 2013 +0200

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/DefsTable.java   | 4 ++++
 src/java/org/apache/cassandra/db/SystemTable.java | 3 +--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/82081c7b/src/java/org/apache/cassandra/db/DefsTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DefsTable.java b/src/java/org/apache/cassandra/db/DefsTable.java
index ea15cd0..4e9cf01 100644
--- a/src/java/org/apache/cassandra/db/DefsTable.java
+++ b/src/java/org/apache/cassandra/db/DefsTable.java
@@ -341,6 +341,10 @@ public class DefsTable
         for (RowMutation mutation : mutations)
             mutation.apply();
 
+        // Must be called after each schema pull and not just on startup to guarantee the
migration.
+        // See CASSANDRA-5800 comments for the details.
+        SystemTable.migrateKeyAlias();
+
         if (!StorageService.instance.isClientMode())
             flushSchemaCFs();
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/82081c7b/src/java/org/apache/cassandra/db/SystemTable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SystemTable.java b/src/java/org/apache/cassandra/db/SystemTable.java
index 81e675e..a87ab50 100644
--- a/src/java/org/apache/cassandra/db/SystemTable.java
+++ b/src/java/org/apache/cassandra/db/SystemTable.java
@@ -184,11 +184,10 @@ public class SystemTable
         migrateKeyAlias();
     }
 
-
     /**
      * 1.1 used a key_alias column; 1.2 changed that to key_aliases as part of CQL3
      */
-    private static void migrateKeyAlias()
+    public static void migrateKeyAlias()
     {
         String selectQuery = String.format("SELECT keyspace_name, columnfamily_name, writetime(type),
key_aliases, key_alias FROM %s.%s",
                                            Table.SYSTEM_KS,


Mime
View raw message