ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject ambari git commit: Ambari upgrade to Ambari 2.4.0 failed during DB upgrade due to incorrect TEZ view regex
Date Wed, 07 Sep 2016 06:35:58 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 9ae52cdca -> 1e86d3b76


Ambari upgrade to Ambari 2.4.0 failed during DB upgrade due to incorrect TEZ view regex


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

Branch: refs/heads/branch-2.5
Commit: 1e86d3b76fb34a891b84bd73d3d96a2a300675d4
Parents: 9ae52cd
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Tue Sep 6 16:02:58 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Wed Sep 7 12:05:08 2016 +0530

----------------------------------------------------------------------
 .../org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java | 4 +++-
 .../apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e86d3b7/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
index 57cce3f..8fa720f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalog.java
@@ -920,7 +920,9 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog
{
             if (tezSite != null) {
               String currentTezHistoryUrlBase = tezSite.getProperties().get("tez.tez-ui.history-url.base");
               if (!StringUtils.isEmpty(currentTezHistoryUrlBase)) {
+                LOG.info("Current Tez History URL base: {} ", currentTezHistoryUrlBase);
                 String newTezHistoryUrlBase = getUpdatedTezHistoryUrlBase(currentTezHistoryUrlBase);
+                LOG.info("New Tez History URL base: {} ", newTezHistoryUrlBase);
                 updateConfigurationProperties("tez-site", Collections.singletonMap("tez.tez-ui.history-url.base",
newTezHistoryUrlBase), true, false);
               }
             }
@@ -937,7 +939,7 @@ public abstract class AbstractUpgradeCatalog implements UpgradeCatalog
{
    * @throws AmbariException if currentTezHistoryUrlBase is malformed or is not compatible
with the Tez View url REGEX
      */
   protected String getUpdatedTezHistoryUrlBase(String currentTezHistoryUrlBase) throws AmbariException{
-    String pattern = "(.*\\/TEZ\\/)(.*)(\\/TEZ_CLUSTER_INSTANCE)";
+    String pattern = "(.*\\/TEZ\\/)(.*)(\\/.*)";
     Pattern regex = Pattern.compile(pattern);
     Matcher matcher = regex.matcher(currentTezHistoryUrlBase);
     String prefix;

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e86d3b7/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java
index 161ed13..2a8122f 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/AbstractUpgradeCatalogTest.java
@@ -208,6 +208,9 @@ public class AbstractUpgradeCatalogTest {
     assertEquals("http://ambari:8080/#/main/views/TEZ/2.2/TEZ_CLUSTER_INSTANCE",
       upgradeCatalog.getUpdatedTezHistoryUrlBase("http://ambari:8080/#/main/views/TEZ/0.7.0.2.5.0.0-665/TEZ_CLUSTER_INSTANCE"));
 
+    assertEquals("http://ambari:8080/#/main/views/TEZ/2.2/tezView",
+        upgradeCatalog.getUpdatedTezHistoryUrlBase("http://ambari:8080/#/main/views/TEZ/0.7.0.2.5.0.0-665/tezView"));
+
     reset(viewDirectory, archiveUtility);
 
     expect(viewDirectory.listFiles(anyObject(FilenameFilter.class))).andReturn(new File[]
{viewJarFile}).anyTimes();


Mime
View raw message