Skip to content

Run the change-offering migrate and resize only once - #14760

Open
bhouse-nexthop wants to merge 1 commit into
apache:mainfrom
bhouse-nexthop:volume-change-offering-duplicate-block
Open

bhouse-nexthop wants to merge 1 commit into
apache:mainfrom
bhouse-nexthop:volume-change-offering-duplicate-block

Conversation

@bhouse-nexthop

Copy link
Copy Markdown
Collaborator

Description

Fixes #14759

changeDiskOfferingForVolumeInternal on main ran 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 reservation try/finally from 4.22.

change why
remove the second copy an offering change needing migration migrated twice, and one needing a resize resized twice
keep the first copy it has main's newer error messages from bc76f20 (#12367). The removed copy has 4.22's older text.
new test changeDiskOfferingForVolumeInternalMigratesAndResizesOnce checks one migrateVolume to the chosen pool with the new offering, and one resizeVolumeInternal

Affects main and 4.23.0.0; 4.22 is not affected. #14752 (4.22) edits this block, and once this lands its merge forward to main only has one copy to update.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Bug Severity

  • Major

How Has This Been Tested?

check result
new test before the fix fails: migrateVolume wanted 1 time, was 2
VolumeApiServiceImplTest after the fix (mvn -pl server -am) 169/169 pass
checkstyle pass

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

codecov Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 20.82%. Comparing base (2737087) to head (d121908).

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #14760      +/-   ##
============================================
+ Coverage     20.80%   20.82%   +0.01%     
- Complexity    20919    20924       +5     
============================================
  Files          6053     6053              
  Lines        548451   548420      -31     
  Branches      78719    73271    -5448     
============================================
+ Hits         114128   114185      +57     
+ Misses       420958   420856     -102     
- Partials      13365    13379      +14     
Flag Coverage Δ
uitests 3.86% <ø> (ø)
unittests 22.25% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change disk offering migrates and resizes a volume twice on main

1 participant