Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 e5ce144a0 -> dddfeb33c
  refs/heads/trunk a196eed80 -> d154f451c


AMBARI-14293. While doing express upgrade multiple Clients and Services Failed 
to start (new patch) (dlysnichenko)


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

Branch: refs/heads/branch-2.2
Commit: dddfeb33cc0f71d5a9ecfad44ce00cd26feebe75
Parents: e5ce144
Author: Lisnichenko Dmitro <[email protected]>
Authored: Tue Dec 15 21:22:12 2015 +0200
Committer: Lisnichenko Dmitro <[email protected]>
Committed: Tue Dec 15 21:22:27 2015 +0200

----------------------------------------------------------------------
 .../libraries/functions/conf_select.py            | 17 ++++++++++++-----
 .../custom_actions/scripts/install_packages.py    | 18 ++++++++++--------
 2 files changed, 22 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dddfeb33/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
----------------------------------------------------------------------
diff --git 
a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
 
b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
index cd3fa5c..ead77a9 100644
--- 
a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
+++ 
b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py
@@ -461,12 +461,9 @@ def convert_conf_directories_to_symlinks(package, version, 
dirs, skip_existing_l
         only_if = format("ls -d {old_conf}/*"))
 
 
-  # Make /usr/hdp/[version]/[component]/conf point to the versioned config.
   # /usr/hdp/current/[component] is already set to to the correct version, 
e.g., /usr/hdp/[version]/[component]
-  try:
-    select("HDP", package, version)
-  except Exception, e:
-    Logger.warning("Could not select the directory for package {0}. Error: 
{1}".format(package, e))
+  
+  link_component_conf_to_versioned_config(package, version)
 
   # Symlink /etc/[component]/conf to /etc/[component]/conf.backup
   try:
@@ -489,3 +486,13 @@ def convert_conf_directories_to_symlinks(package, version, 
dirs, skip_existing_l
         Logger.error("Unsupported 'link_to' argument. Could not link package 
{0}".format(package))
   except Exception, e:
     Logger.warning("Could not change symlink for package {0} to point to {1} 
directory. Error: {2}".format(package, link_to, e))
+
+
+def link_component_conf_to_versioned_config(package, version):
+  """
+  Make /usr/hdp/[version]/[component]/conf point to the versioned config.
+  """
+  try:
+    select("HDP", package, version)
+  except Exception, e:
+    Logger.warning("Could not select the directory for package {0}. Error: 
{1}".format(package, e))

http://git-wip-us.apache.org/repos/asf/ambari/blob/dddfeb33/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py 
b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
index ae66fe0..e88f554 100644
--- 
a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
+++ 
b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py
@@ -190,15 +190,17 @@ class InstallPackages(Script):
       Logger.info("Configuration symlinks are not needed for {0}, only 
HDP-2.3+".format(stack_version))
       return
 
-    # if already on HDP 2.3, then there's nothing to do in terms of linking 
configs
-    if self.current_hdp_stack_version and 
compare_versions(self.current_hdp_stack_version, '2.3') >= 0:
-      Logger.info("The current cluster stack of {0} does not require linking 
configurations".format(stack_version))
-      return
-
-    # link configs for all known packages
     for package_name, directories in conf_select.PACKAGE_DIRS.iteritems():
-      conf_select.convert_conf_directories_to_symlinks(package_name, 
stack_version, directories,
-        skip_existing_links = False, link_to = "backup")
+      # if already on HDP 2.3, then we should skip making conf.backup folders
+      if self.current_hdp_stack_version and 
compare_versions(self.current_hdp_stack_version, '2.3') >= 0:
+        Logger.info("The current cluster stack of {0} does not require backing 
up configurations; "
+                    "only conf-select versioned config directories will be 
created.".format(stack_version))
+        # only link configs for all known packages
+        conf_select.link_component_conf_to_versioned_config(package_name, 
stack_version)
+      else:
+        # link configs and create conf.backup folders for all known packages
+        conf_select.convert_conf_directories_to_symlinks(package_name, 
stack_version, directories,
+          skip_existing_links = False, link_to = "backup")
 
 
   def compute_actual_version(self):

Reply via email to