Repository navigation
kvm: look up the storage pool once in GetVolumeStatsCommand and keep stats of resolvable volumes - #14889
Open
stag7824 wants to merge 1 commit into
Open
kvm: look up the storage pool once in GetVolumeStatsCommand and keep stats of resolvable volumes#14889stag7824 wants to merge 1 commit into
stag7824 wants to merge 1 commit into
Conversation
…stats of resolvable volumes The wrapper looked up the storage pool once per volume, and returned no stats at all when a single volume could not be resolved. Look the pool up once, skip volumes that can't be resolved (logged as warnings), and only return no stats when the pool or every volume is unavailable. Fixes apache#14874.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes #14874.
LibvirtGetVolumeStatsCommandWrapperlooked up the storage pool inside its per-volume loop, so aGetVolumeStatsCommandwith N volumes did N full pool lookups (each onestoragePoolLookupByUUIDString, pool XML parsing andgetInfo()), and each could wait on theKVMStoragePoolManagermonitor while aGetStorageStatsCommandrefreshes the pool. It also returned no stats at all as soon as one volume could not be resolved, so the stats of every other volume in the command were lost.Changes, all in the wrapper:
GetVolumeStatsCommandare on the same pool.getPhysicalDiskreturns null or throwsCloudRuntimeException) is logged as a warning and skipped, and the stats of the other volumes are returned.Connectthe wrapper fetched was never used, so it is no longer fetched.On the management server,
UserVmManagerImpl.getVolumeStatistics()already merges whatever entries an answer contains (putAll), so a partial map needs no change there.This does not touch the separate points in the issue about every management server running
VolumeStatsTask, or thesynchronizedpool lookup itself.Types of changes
Bug Severity
How Has This Been Tested?
New
LibvirtGetVolumeStatsCommandWrapperTest(5 tests):Against the current 4.22 code, the first two fail as expected (
Wanted 1 time: But was 3 timesfor the pool lookup; no stats for the partial case). With the change, all 5 pass. Checkstyle passes for the module.I have not run it on a KVM host with RBD storage.