MitchDrage opened a new pull request, #14398: URL: https://github.com/apache/cloudstack/pull/14398
### Description Fixes #14397 This PR makes each management server collect VM stats only from the hosts connected to it. Previously every management server polled every host, so with 3 management servers each VM got 3 rows in `vm_stats` per interval. - `VmStatsCollector` now filters its host search on `managementServerId`. - `HostCollector` is unchanged and still collects from all hosts. - Added unit tests for both collectors' host searches. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [ ] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [x] Minor - [ ] Trivial ### Screenshots (if appropriate): ### How Has This Been Tested? - `StatsCollectorTest` passes (60 tests), including the two new ones. - With the fix removed, the new `VmStatsCollector` test fails. #### How did you try to break this feature and the system with this change? - Checked that nothing reads `vm_stats.mgmt_server_id`. The UI charts, `listVirtualMachines` and the cleanup job all query by VM ID and timestamp and select the newest returned row, so they still see every VM's stats. - If a host reconnects to a different management server, at most one or two samples are missed. -- 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]
