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 76727200B79 for ; Tue, 23 Aug 2016 10:03:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 752B0160AA5; Tue, 23 Aug 2016 08:03:22 +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 BBF88160ABF for ; Tue, 23 Aug 2016 10:03:21 +0200 (CEST) Received: (qmail 20957 invoked by uid 500); 23 Aug 2016 08:03:20 -0000 Mailing-List: contact dev-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list dev@cloudstack.apache.org Received: (qmail 20813 invoked by uid 99); 23 Aug 2016 08:03:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Aug 2016 08:03:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9AD35DFE2C; Tue, 23 Aug 2016 08:03:19 +0000 (UTC) From: rhtyd To: dev@cloudstack.apache.org Reply-To: dev@cloudstack.apache.org Message-ID: Subject: [GitHub] cloudstack pull request #1656: CLOUDSTACK-9466: Fix fk constraint failure in... Content-Type: text/plain Date: Tue, 23 Aug 2016 08:03:19 +0000 (UTC) archived-at: Tue, 23 Aug 2016 08:03:22 -0000 GitHub user rhtyd opened a pull request: https://github.com/apache/cloudstack/pull/1656 CLOUDSTACK-9466: Fix fk constraint failure in upgrade path In the 4.1.0-4.2.0 db upgrade path, it creates new tables to store secondary (nfs) storage in image_store table and volumes in volume_store_ref table. In the upgrade path, it first tries to migrate NFS storage pool where it excludes storage pools which have been removed, but it migrates all the volumes without checking if their storage pools have been removed. This causes fk constraint failure as the volume/row being inserted refers to a storage pool which does not exist in the image_store table. The fix migrates all the nfs storage pools to image_store including removed storage pools and in doing so migrates with the 'removed' field. This fixes db upgrade for old pre-4.0 and 4.0/4.1 CloudStack clouds. /cc @jburwell @PaulAngus @karuturi @abhinandanprateek @murali-reddy You can merge this pull request into a Git repository by running: $ git pull https://github.com/shapeblue/cloudstack 4.9-fk410to420fix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/1656.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1656 ---- commit 1b678cbcaaff29024ffa93c10a36954eaa874f6a Author: Rohit Yadav Date: 2016-08-23T07:53:18Z CLOUDSTACK-9466: Fix fk constraint failure in upgrade path In the 4.1.0-4.2.0 db upgrade path, it creates new tables to store secondary (nfs) storage in image_store table and volumes in volume_store_ref table. In the upgrade path, it first tries to migrate NFS storage pool where it excludes storage pools which have been removed, but it migrates all the volumes without checking if their storage pools have been removed. This causes fk constraint failure as the volume/row being inserted refers to a storage pool which does not exist in the image_store table. The fix migrates all the nfs storage pools to image_store including removed storage pools and in doing so migrates with the 'removed' field. This fixes db upgrade for old pre-4.0 and 4.0/4.1 CloudStack clouds. Signed-off-by: Rohit Yadav ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---