weizhouapache commented on code in PR #12140:
URL: https://github.com/apache/cloudstack/pull/12140#discussion_r2569349428


##########
engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java:
##########
@@ -468,7 +468,7 @@ public Boolean doInTransaction(TransactionStatus status) {
                      ResultSet rs = pstmt.executeQuery()) {
                     if (rs.next()) {
                         int count = rs.getInt(1);
-                        return count <= 1;
+                        return count = 0;

Review Comment:
   == or = ?



##########
engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java:
##########
@@ -448,39 +451,71 @@ public void check() {
                 throw new CloudRuntimeException("Unable to acquire lock to 
check for database integrity.");
             }
 
-            try {
-                initializeDatabaseEncryptors();
+            // not sure about the right moment to do this yet
+            checkIfStandalone();
+            doUpgrades(lock);
+        } finally {
+            lock.releaseRef();
+        }
+    }
+    private void checkIfStandalone() throws CloudRuntimeException {
+        boolean standalone = Transaction.execute(new TransactionCallback<>() {
+            @Override
+            public Boolean doInTransaction(TransactionStatus status) {
+                String sql = "SELECT COUNT(*) FROM `cloud`.`mshosts` WHERE 
`state` = 'UP'";

Review Comment:
   mshost ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to