You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by ra...@apache.org on 2018/03/22 10:57:49 UTC

phoenix git commit: PHOENIX-4655 Upgrade to latest version from version <4.8.0 may fail with TableNotFoundException if we have local indexes but no multi-tenant tables.(Rajeshbabu)

Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 31c674a82 -> 0bcf1227b


PHOENIX-4655 Upgrade to latest version from version <4.8.0 may fail with TableNotFoundException if we have local indexes but no multi-tenant tables.(Rajeshbabu)


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

Branch: refs/heads/5.x-HBase-2.0
Commit: 0bcf1227b28085c90625092728174f1f8a5427cc
Parents: 31c674a
Author: Rajeshbabu Chintaguntla <ra...@apache.org>
Authored: Thu Mar 22 16:27:15 2018 +0530
Committer: Rajeshbabu Chintaguntla <ra...@apache.org>
Committed: Thu Mar 22 16:27:15 2018 +0530

----------------------------------------------------------------------
 .../src/main/java/org/apache/phoenix/util/UpgradeUtil.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/0bcf1227/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java b/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
index 06358e6..6fbe760 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
@@ -607,8 +607,10 @@ public class UpgradeUtil {
                         String indexPhysicalTableName = MetaDataUtil.getViewIndexTableName(viewPTable.getPhysicalName().getString());
                         if (physicalTables.add(indexPhysicalTableName)) {
                             final TableName tableName = TableName.valueOf(indexPhysicalTableName);
-                            admin.disableTable(tableName);
-                            admin.truncateTable(tableName, false);
+                            if(admin.tableExists(tableName)) {
+                                admin.disableTable(tableName);
+                                admin.truncateTable(tableName, false);
+                            }
                         }
                     }
                 }