Avoid double initialization of metadata for new tables

Patch by Sam Tunnicliffe; reviewed by Aleksey Yeschenko for
CASSANDRA-11027


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

Branch: refs/heads/trunk
Commit: cb21f28ecadceaac78aba1c2de4670afc2c38daa
Parents: 8cb5a20
Author: Sam Tunnicliffe <s...@beobal.com>
Authored: Wed Jan 20 10:07:10 2016 +0000
Committer: Sam Tunnicliffe <s...@beobal.com>
Committed: Wed Feb 3 12:00:59 2016 +0000

----------------------------------------------------------------------
 CHANGES.txt                                      | 1 +
 src/java/org/apache/cassandra/config/Schema.java | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb21f28e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ef0da4c..6e313c3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.3
+ * Remove double initialization of newly added tables (CASSANDRA-11027)
  * Filter keys searcher results by target range (CASSANDRA-11104)
  * Fix deserialization of legacy read commands (CASSANDRA-11087)
  * Fix incorrect computation of deletion time in sstable metadata 
(CASSANDRA-11102)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb21f28e/src/java/org/apache/cassandra/config/Schema.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/config/Schema.java 
b/src/java/org/apache/cassandra/config/Schema.java
index cf3f569..7ffa89e 100644
--- a/src/java/org/apache/cassandra/config/Schema.java
+++ b/src/java/org/apache/cassandra/config/Schema.java
@@ -606,8 +606,8 @@ public class Schema
     {
         assert getCFMetaData(cfm.ksName, cfm.cfName) == null;
 
-        // Make sure the keyspace is initialized and initialize the table.
-        Keyspace.open(cfm.ksName).initCf(cfm, true);
+        // Make sure the keyspace is initialized
+        Keyspace.open(cfm.ksName);
         // Update the keyspaces map with the updated metadata
         update(cfm.ksName, ks -> ks.withSwapped(ks.tables.with(cfm)));
         // Update the table ID <-> table name map (cfIdMap)

Reply via email to