Updated Branches: refs/heads/master bc98bca7f -> 1042136c2
CLOUDSTACK-4661:[DB Upgrade] SecondaryStorage entry in host table before upgrade is not marked as removed after migrating them to image_store table. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/1042136c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/1042136c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/1042136c Branch: refs/heads/master Commit: 1042136c23834f7eff87227fd2818b56f6e8197e Parents: bc98bca Author: Min Chen <[email protected]> Authored: Thu Sep 12 18:52:40 2013 -0700 Committer: Min Chen <[email protected]> Committed: Thu Sep 12 18:55:41 2013 -0700 ---------------------------------------------------------------------- engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/1042136c/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java index d27dfa7..02dd9c5 100755 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java @@ -2197,6 +2197,11 @@ public class Upgrade410to420 implements DbUpgrade { storeInsert.setDate(9, nfs_created); storeInsert.executeUpdate(); } + + s_logger.debug("Marking NFS secondary storage in host table as removed"); + pstmt = conn.prepareStatement("UPDATE `cloud`.`host` SET removed = now() WHERE type = 'SecondaryStorage' and removed is null"); + pstmt.executeUpdate(); + pstmt.close(); } catch (SQLException e) { String msg = "Unable to migrate secondary storages." + e.getMessage();
