Updated Branches: refs/heads/4.2-forward 3919b9fd2 -> a096c9667
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/a096c966 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a096c966 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a096c966 Branch: refs/heads/4.2-forward Commit: a096c966725cbe083c8c537beb43b3928750b3ca Parents: 3919b9f Author: Min Chen <[email protected]> Authored: Thu Sep 12 18:52:40 2013 -0700 Committer: Min Chen <[email protected]> Committed: Thu Sep 12 18:52:40 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/a096c966/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 3d4ba58..3c753e9 100755 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade410to420.java @@ -2238,6 +2238,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();
