From dev-return-14753-apmail-sqoop-dev-archive=sqoop.apache.org@sqoop.apache.org Tue Oct 28 03:09:35 2014 Return-Path: X-Original-To: apmail-sqoop-dev-archive@www.apache.org Delivered-To: apmail-sqoop-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4195A17330 for ; Tue, 28 Oct 2014 03:09:35 +0000 (UTC) Received: (qmail 3841 invoked by uid 500); 28 Oct 2014 03:09:34 -0000 Delivered-To: apmail-sqoop-dev-archive@sqoop.apache.org Received: (qmail 3757 invoked by uid 500); 28 Oct 2014 03:09:34 -0000 Mailing-List: contact dev-help@sqoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sqoop.apache.org Delivered-To: mailing list dev@sqoop.apache.org Received: (qmail 3623 invoked by uid 99); 28 Oct 2014 03:09:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 28 Oct 2014 03:09:34 +0000 Date: Tue, 28 Oct 2014 03:09:34 +0000 (UTC) From: "Veena Basavaraj (JIRA)" To: dev@sqoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SQOOP-1625) Repository upgrade issue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SQOOP-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14186273#comment-14186273 ] Veena Basavaraj commented on SQOOP-1625: ---------------------------------------- Discussing a bit more, the real issue is this. Qian is trying to install new binaries with a exisiting DB at "repository.version" in SQ_SYSTEM at 4. So in this case the upgrade should not be kicked off at all. Since the latest code version is 4 {code} public static final int LATEST_DERBY_REPOSITORY_VERSION = 4; {code} and the schems repo version is all 4 > Repository upgrade issue > ------------------------ > > Key: SQOOP-1625 > URL: https://issues.apache.org/jira/browse/SQOOP-1625 > Project: Sqoop > Issue Type: Bug > Affects Versions: 1.99.4 > Reporter: Qian Xu > > I'm facing such a situation. > 1. I recompile the project without changing anything. > 2. I replace old binaries with newly built binaries (derby's repository is kept unchanged) > 3. I restart Sqoop2 server, it will trigger an upgrade check. > As the repository version is not incremented, I expect nothing to be update. But I see a SQL error: > {code} > Caused by: ERROR 42Z93: Constraints 'FK_SQB_NAME_UNIQUE' and 'FK_SQB_NAME_UNIQUE' have the same set of columns, which is not allowed. > {code} > In DerbyRepositoryHandler.java, constraints will be added to repository, if repository version is greater than 3, Sqoop will attempt to add particular constraints repeatedly. I'm afraid this will fail. > {code} > // Add unique constraints on job and links for version 4 onwards > if (repositoryVersion > 3) { > runQuery(QUERY_UPGRADE_TABLE_SQ_JOB_ADD_UNIQUE_CONSTRAINT_NAME, conn); > runQuery(QUERY_UPGRADE_TABLE_SQ_LINK_ADD_UNIQUE_CONSTRAINT_NAME, conn); > runQuery(QUERY_UPGRADE_TABLE_SQ_CONFIGURABLE_ADD_UNIQUE_CONSTRAINT_NAME, conn); > } > {code} > So I'm thinking, whether we should do as follows: > 1. Increase the current repository version to 5 (instead of 4) and > 2. Change the following code > {code} > // original > if (repositoryVersion > 3) { > // proposed > if (repositoryVersion <= 4) { > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)