Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 08838200D0C for ; Wed, 20 Sep 2017 15:24:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 06E131609E2; Wed, 20 Sep 2017 13:24:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2672E1609E1 for ; Wed, 20 Sep 2017 15:24:05 +0200 (CEST) Received: (qmail 61542 invoked by uid 500); 20 Sep 2017 13:24:05 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 61533 invoked by uid 99); 20 Sep 2017 13:24:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Sep 2017 13:24:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D58F91A3C50 for ; Wed, 20 Sep 2017 13:24:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id AeW2ImbcfL-g for ; Wed, 20 Sep 2017 13:24:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C92DF60CEB for ; Wed, 20 Sep 2017 13:24:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 01007E0EE8 for ; Wed, 20 Sep 2017 13:24:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 701A8218FA for ; Wed, 20 Sep 2017 13:24:00 +0000 (UTC) Date: Wed, 20 Sep 2017 13:24:00 +0000 (UTC) From: "Dmitry Lysnichenko (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (AMBARI-21854) Adapt Repository Files For Existing Deployments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 20 Sep 2017 13:24:07 -0000 [ https://issues.apache.org/jira/browse/AMBARI-21854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16173170#comment-16173170 ] Dmitry Lysnichenko edited comment on AMBARI-21854 at 9/20/17 1:23 PM: ---------------------------------------------------------------------- Committed to 2.6 To https://git-wip-us.apache.org/repos/asf/ambari.git f64d027dba..412c6cac44 branch-2.6 -> branch-2.6 trunk patch is pending was (Author: dmitriusan): Committed to 2.6 To https://git-wip-us.apache.org/repos/asf/ambari.git f64d027dba..412c6cac44 branch-2.6 -> branch-2.6 > Adapt Repository Files For Existing Deployments > ----------------------------------------------- > > Key: AMBARI-21854 > URL: https://issues.apache.org/jira/browse/AMBARI-21854 > Project: Ambari > Issue Type: Bug > Components: ambari-agent > Affects Versions: 2.6.0 > Reporter: Jonathan Hurley > Assignee: Dmytro Grinenko > Priority: Blocker > Fix For: 2.6.0 > > > The recent changes in repository creation and management (AMBARI-20871, AMBARI-21719, AMBARI-21398) has caused a regression with previously installed packages. Using RPM as an example, consider the following case: > - A version of Ambari is installed which writes out a repo file for HDP. This file could be named anything and may vary depending on the version of Ambari being used. It could be {{hdp.repo}}, {{hdp-2.6.repo}}, or really any variation. The point is that it's not predictable. > - The repo ID inside of the file can also be anything. In some cases it may be "HDP-2.6.2.0" or "HDP-2.6.2.0-193". But once again, the point is that it's not predictable. > - What is known is that packages previously installed with this repo are now associated with it permanently: > {code} > [root@c6401 yum.repos.d]# yum list installed | grep hive2 > hive2_2_6_2_0_193.noarch 2.1.0.2.6.2.0-193 @HDP-2.6.2.0-193 > hive2_2_6_2_0_193-jdbc.noarch 2.1.0.2.6.2.0-193 @HDP-2.6.2.0-193 > {code} > - Ambari has now changed the way in which we create repo files and the naming scheme we use for the repo ID. Consider a fresh installation of Ambari 2.6: > {code:title=/etc/yum.repos.d/ambari-hdp-1.repo} > [HDP-2.5-repo-1] > name=HDP-2.5-repo-1 > baseurl=http://repo.ambari.apache.org/hdp/centos6/HDP-2.5.0.0-1237 > path=/ > enabled=1 > gpgcheck=0 > [HDP-UTILS-1.1.0.21-repo-1] > name=HDP-UTILS-1.1.0.21-repo-1 > baseurl=http://repo.ambari.apache.org/hdp/centos6/HDP-UTILS-1.1.0.21 > path=/ > enabled=1 > gpgcheck=0 > {code} > -- "1" is the ID of the repo_version entry in Ambari - so the filename is ambari-- > -- Yum Repo ID (HDP-2.5-repo-1) - the repo name used in the file is --repo- > This presents a problem when upgrading a prior version of Ambari. Although there is still only 1 record in the {{repo_version}} table, we create a 2nd repo file in {{/etc/yum.repos.d}} with an entirely different repository ID and name. Because the packages were previously installed with another repo identifier, our new code which restricts to the repository associated with the command, can't find packages and produces an error. > - This prevents new components from being added to hosts > - Client restarts and reinstalls fail > - Sysprepped Hosts can't be managed > The {{yum}} command doesn't really allow for us to determine the packages installed from other repos nor does it allow the reassignment of installed packages from one repo to another. > Consider the case where Hive is already installed and then the cluster is upgraded to Ambari 2.6. When we go to add new hive components, we are restricting the packages to that of the current repo ({{HDP\-2.5\-repo\-1}}): > {code} > [root@c6401 ~]# yum list available --disablerepo=* --enablerepo=HDP-2.5-repo-1 | grep hive2 > hive2.noarch 2.1.0.2.5.0.0-1237.el6 HDP-2.5-repo-1 > hive2-jdbc.noarch 2.1.0.2.5.0.0-1237.el6 HDP-2.5-repo-1 > {code} > Unfortunately, this misses the hive already installed since they are associated with another repo ({{@HDP\-2.6.2.0\-193}}) > {code} > hive2_2_6_2_0_193.noarch 2.1.0.2.6.2.0-193 @HDP-2.6.2.0-193 > hive2_2_6_2_0_193-jdbc.noarch 2.1.0.2.6.2.0-193 @HDP-2.6.2.0-193 > {code} > I think the following needs to be done to fix this situation: > - If the repo file exists, then do nothing if the file contents match > - If the repo file does not exist, then scan {{/etc/yum.repos.d}} to see if any repos match the URL. If we hit a match, then we need to scan the repo to extract the old, original repository ID -- This message was sent by Atlassian JIRA (v6.4.14#64029)