PHOENIX-5017 Fix testRecreateViewWhoseParentWasDropped test flapper

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

Branch: refs/heads/4.x-cdh5.15
Commit: 7afa9549df2e5f14f963a5c61d0cce006fb4a014
Parents: 21c3a7c
Author: Thomas D'Silva <tdsi...@apache.org>
Authored: Tue Nov 13 23:42:19 2018 +0000
Committer: Pedro Boado <pbo...@apache.org>
Committed: Tue Nov 27 15:11:45 2018 +0000

----------------------------------------------------------------------
 .../phoenix/coprocessor/MetaDataEndpointImpl.java       | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/7afa9549/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
index d899e32..5562340 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java
@@ -2035,8 +2035,7 @@ public class MetaDataEndpointImpl extends 
MetaDataProtocol implements Coprocesso
                 }
             }
             
-            // check if the table was dropped, but had child views that were 
have not yet
-            // been cleaned up by compaction
+            // check if the table was dropped, but had child views that were 
have not yet been cleaned up
             if 
(!Bytes.toString(schemaName).equals(QueryConstants.SYSTEM_SCHEMA_NAME)) {
                 dropChildViews(env, tenantIdBytes, schemaName, tableName);
             }
@@ -2434,8 +2433,13 @@ public class MetaDataEndpointImpl extends 
MetaDataProtocol implements Coprocesso
                     MetaDataClient client = new MetaDataClient(connection);
                     org.apache.phoenix.parse.TableName viewTableName = 
org.apache.phoenix.parse.TableName
                             .create(Bytes.toString(viewSchemaName), 
Bytes.toString(viewName));
-                    client.dropTable(
-                            new DropTableStatement(viewTableName, 
PTableType.VIEW, false, true, true));
+                    try {
+                        client.dropTable(
+                                new DropTableStatement(viewTableName, 
PTableType.VIEW, false, true, true));
+                    }
+                    catch (TableNotFoundException e) {
+                        logger.info("Ignoring view "+viewTableName+" as it has 
already been dropped");
+                    }
                 }
             }
         }

Reply via email to