You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by wi...@apache.org on 2013/09/17 16:01:49 UTC

[28/50] [abbrv] git commit: updated refs/heads/disk-cache to c3569db

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/disk-cache
Commit: 1042136c23834f7eff87227fd2818b56f6e8197e
Parents: bc98bca
Author: Min Chen <mi...@citrix.com>
Authored: Thu Sep 12 18:52:40 2013 -0700
Committer: Min Chen <mi...@citrix.com>
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();