Repository navigation
Run the change-offering migrate and resize only once - #14760
bhouse-nexthop wants to merge 1 commit into
Conversation
changeDiskOfferingForVolumeInternal on main carried its tail block twice: the no-op check, the migrate step and the resize step. The 4.22 merge 82bfa9f kept both main's copy and 4.22's copy when it wrapped the method in the reservation try/finally from 9c0c8da. - An offering change that needed a migration migrated the volume twice, the second time to a pool picked from the pool list computed before the first move. - An offering change that needed a resize resized twice. - Kept the first copy: it carries main's newer error messages from bc76f20 (apache#12367). The removed copy is 4.22's older text. - Added a test that a change needing migration and resize calls migrateVolume and resizeVolumeInternal once each. Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14760 +/- ##
============================================
+ Coverage 20.80% 20.88% +0.07%
- Complexity 20919 20989 +70
============================================
Files 6053 6053
Lines 548451 548808 +357
Branches 78719 73390 -5329
============================================
+ Hits 114128 114614 +486
+ Misses 420958 420814 -144
- Partials 13365 13380 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tested on a KVM lab running a main (24.0) build that includes this change. Primary storage is Ceph RBD. Steps: changed a 2 GiB DATA volume, attached to a Running VM, to a fixed 3 GB disk offering on the same storage, so the change needs a resize and no migration. I counted the resizes for that volume. Result: all checks passed.
Before this change, the duplicated block ran the resize a second time (#14759). That gives 2 usage events, and the second command reaches the agent with the size already updated. Not tested: a change that needs a migration, with or without a resize. |
Description
Fixes #14759
changeDiskOfferingForVolumeInternalonmainran its tail twice: the no-op check, the migrate step and the resize step. Merge 82bfa9f produced the second copy when it resolved 9c0c8da's reservationtry/finallyfrom 4.22.changeDiskOfferingForVolumeInternalMigratesAndResizesOncemigrateVolumeto the chosen pool with the new offering, and oneresizeVolumeInternalAffects
mainand 4.23.0.0; 4.22 is not affected. #14752 (4.22) edits this block, and once this lands its merge forward tomainonly has one copy to update.Types of changes
Bug Severity
How Has This Been Tested?
migrateVolumewanted 1 time, was 2VolumeApiServiceImplTestafter the fix (mvn -pl server -am)