mike-tutkowski opened a new pull request #2415: CLOUDSTACK-10244: KVM online 
storage migration fails and corrupts disk
URL: https://github.com/apache/cloudstack/pull/2415
 
 
   This is an issue that was introduced in the code-review process of 
https://github.com/apache/cloudstack/pull/2298.
   
   What is probably the simplest solution (and what this PR does) is to store 
the result of MapUtils.isNotEmpty(mapMigrateStorage) before passing 
mapMigrateStorage to the replaceStorage method.
   
   The replaceStorage method can mutate the data in the passed-in map, thus 
leading to a different result for MapUtils.isNotEmpty(mapMigrateStorage) later 
on (and causing an issue for online storage migration).
   
   If we just store the value up front and refer to it later, we, of course, 
get the same (boolean) result and online storage migration works properly.
   
   A more long-term solution (and one that I plan on implementing for 4.12) 
would be to make a shallow copy of the map inside of replaceStorage so that 
replaceStorage does not actually mutate the data in the original map. While 
that isn't a difficult solution to implement, I feel the one I have implemented 
in this PR is safer as we are in the release-candidate process already.
   
   Here is a link to the JIRA ticket:
   
   https://issues.apache.org/jira/browse/CLOUDSTACK-10244
   
   I have tested the code and validated that it works.
   
   This use case only applies to online storage migration from NFS or Ceph to 
managed storage, which is a new feature for 4.11.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to