mlsorensen opened a new pull request #5789: URL: https://github.com/apache/cloudstack/pull/5789
* Managed volume copy was always returning first host that could see storage pools * Fix null value in logging for ScaleIOPrimaryDataStoreDriver due to if/else logic error Signed-off-by: Marcus Sorensen <[email protected]> ### Description This PR fixes #5788 It shuffles the list of valid host candidates that are used for processing volume migrations. It also fixes a logic error in debug logging that caused 'null' to be printed. Originally concatenating a static string with potentially null value and then testing to see if the result is null, which would never be true. A more ideal solution might be to track the jobs on each host and attempt to balance the load according to how busy each host is. This was investigated and there's currently no obvious way to look up job assignments to hosts via the DB, the Commands sent to Agents are kept live in memory via the AgentAttache. The ideal solution would be a much larger feature to coordinate Command assignments across the management server cluster, and possibly need improved agent comms to provide live status of Command progress. I additionally spent some time looking into how to isolate and unit test `findUpAndEnabledHostWithAccessToStoragePools()`. Currently it would require mocking three Daos, the DataStoreProviderManager, a DataStoreProvider, and a DataStoreDriver. It's possible to write a test for this, however I was concerned that the unit test would be coding implementation across three methods into the test. These mocked Daos exist up to three methods deep - if the implementation of any of these methods changes then the test needs to be rewritten to code in the new implementation. I wasn't sure this was the right thing to do just to add a simple one-line shuffle but I'm happy to go that route if needed. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [X] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [X] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [X] Minor - [ ] Trivial ### How Has This Been Tested? Have run this code against a live environment and tested volume migration. -- 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]
