cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adelap...@apache.org
Subject [2/6] cassandra git commit: Skip materialized view addition if the base table doesn't exist
Date Mon, 07 Aug 2017 19:42:27 GMT
Skip materialized view addition if the base table doesn't exist

patch by Andres de la Peña; reviewed by Jake Luciani for CASSANDRA-13737


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

Branch: refs/heads/cassandra-3.11
Commit: 918667929f87a2e8e74913fe6d6e5dd137fe4e4f
Parents: d9eabd3
Author: Andrés de la Peña <a.penya.garcia@gmail.com>
Authored: Mon Aug 7 20:26:09 2017 +0100
Committer: Andrés de la Peña <a.penya.garcia@gmail.com>
Committed: Mon Aug 7 20:26:09 2017 +0100

----------------------------------------------------------------------
 CHANGES.txt                                            | 1 +
 src/java/org/apache/cassandra/db/view/ViewManager.java | 9 +++++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/91866792/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 799e7f4..905a436 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.15
+ * Skip materialized view addition if the base table doesn't exist (CASSANDRA-13737)
  * Drop table should remove corresponding entries in dropped_columns table (CASSANDRA-13730)
  * Log warn message until legacy auth tables have been migrated (CASSANDRA-13371)
  * Fix incorrect [2.1 <- 3.0] serialization of counter cells created in 2.0 (CASSANDRA-13691)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/91866792/src/java/org/apache/cassandra/db/view/ViewManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/view/ViewManager.java b/src/java/org/apache/cassandra/db/view/ViewManager.java
index fd04b97..0a0fa7b 100644
--- a/src/java/org/apache/cassandra/db/view/ViewManager.java
+++ b/src/java/org/apache/cassandra/db/view/ViewManager.java
@@ -136,6 +136,15 @@ public class ViewManager
 
     public void addView(ViewDefinition definition)
     {
+        // Skip if the base table doesn't exist due to schema propagation issues, see CASSANDRA-13737
+        if (!keyspace.hasColumnFamilyStore(definition.baseTableId))
+        {
+            logger.warn("Not adding view {} because the base table {} is unknown",
+                        definition.viewName,
+                        definition.baseTableId);
+            return;
+        }
+
         View view = new View(definition, keyspace.getColumnFamilyStore(definition.baseTableId));
         forTable(view.getDefinition().baseTableMetadata()).add(view);
         viewsByName.put(definition.viewName, view);


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


Mime
View raw message