You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2020/05/28 01:24:00 UTC

[GitHub] [phoenix] gjacoby126 commented on a change in pull request #790: PHOENIX-5922 - IndexUpgradeTool should always re-enable tables on fai…

gjacoby126 commented on a change in pull request #790:
URL: https://github.com/apache/phoenix/pull/790#discussion_r431531187



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexUpgradeTool.java
##########
@@ -398,28 +414,34 @@ private int executeTool(Connection conn,
         executeToolForMutableTables(conn, queryServices, conf, mutableList);
         enableImmutableTables(queryServices, immutableList, startWaitTime);
         rebuildIndexes(conn, conf, immutableList);
-        return 0;
+        if (hasFailure) {
+            return -1;
+        } else {
+            return 0;
+        }
     }
 
     private long executeToolForImmutableTables(ConnectionQueryServices queryServices,
-            ArrayList<String> immutableList) {
+            List<String> immutableList) {
         if (immutableList.isEmpty()) {
             return 0;
         }
         LOGGER.info("Started " + operation + " for immutable tables");
+        List<String> failedTables = new ArrayList<String>();
         for (String dataTableFullName : immutableList) {
             try (Admin admin = queryServices.getAdmin()) {
                 HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName);
                 LOGGER.info("Executing " + operation + " of " + dataTableFullName
                         + " (immutable)");
                 disableTable(admin, dataTableFullName, indexes);
                 modifyTable(admin, dataTableFullName, indexes);
-            } catch (IOException | SQLException e) {
+            } catch (IOException | SQLException | RuntimeException e) {

Review comment:
       Done

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/mapreduce/index/IndexUpgradeTool.java
##########
@@ -463,14 +489,20 @@ private void handleFailure(ConnectionQueryServices queryServices,
             upgrade = !upgrade;
 
             tablesAndIndexes.remove(dataTableFullName); //removing from the map
-            tableList.remove(dataTableFullName); //removing from the list
+            failedTables.add(dataTableFullName); //removing from the list

Review comment:
       Fixed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org