Damans227 commented on code in PR #13023:
URL: https://github.com/apache/cloudstack/pull/13023#discussion_r4284708474


##########
server/src/main/java/org/apache/cloudstack/storage/heuristics/HeuristicRuleHelper.java:
##########
@@ -272,6 +272,10 @@ public DataStore interpretHeuristicRule(String rule, 
HeuristicType heuristicType
                         "returning a valid UUID.", scriptReturn, rule));
             }
 
+            if (dataStoreManager.isRemovedOrReadonly(dataStore)) {
+                throw new CloudRuntimeException(String.format("DataStore [{}] 
returned by heuristic rule is marked as read-only.", dataStore));

Review Comment:
   should this be %s instead of {}? String.format leaves the {} as is so the 
store never shows up in the error



##########
engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java:
##########
@@ -295,10 +298,14 @@ public void handleSysTemplateDownload(HypervisorType 
hostHyper, Long dcId) {
     }
 
     protected boolean shouldDownloadTemplateToStore(VMTemplateVO template, 
DataStore store) {
+        if (_storeMgr.isRemovedOrReadonly(store)) {
+            return false;
+        }
+
         Long zoneId = store.getScope().getScopeId();
         DataStore directedStore = 
_tmpltMgr.verifyHeuristicRulesForZone(template, zoneId);

Review Comment:
   what happens to the template sync when the rule points at a read-only store? 
looks like this now throws mid loop and the rest of the templates for that 
store get skipped



-- 
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