bhouse-nexthop opened a new pull request, #14771:
URL: https://github.com/apache/cloudstack/pull/14771
### Description
Fixes #14770
In `SnapshotDataFactoryImpl.getSnapshot(snapshotId, role, zoneId,
retrieveAnySnapshotFromVolume)`: a one-character fix (the stray `;` after the
fallback `if`) plus a null-safe zone compare.
| | Before | After |
|---|---|---|
| fallback loop | `if (...); {` is a no-op, first copy from any zone
returned | only a copy in `zoneId` returned |
| zone compare (both loops) | `long == Long`, NPE when `getStoreZoneId`
returns null | `Long.valueOf(zoneId).equals(...)`, null ref skipped |
Same code is on main.
Behaviour change: when the snapshot has no copy in the requested zone,
`getSnapshotWithRoleAndZone` now returns null instead of another zone's copy.
Callers already had to handle null (it was returned when no copy existed at
all).
### Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
### Bug Severity
- [x] Minor
### How Has This Been Tested?
| What | Result |
|---|---|
| `mvn -pl engine/storage/snapshot test -Dtest=SnapshotDataFactoryImplTest`
| 2 tests, pass |
No new unit test; the change is the removed `;` and the compare.
### Not in scope (pre-existing)
- `ImageStoreProviderManagerImpl.getImageStoreZoneId` unboxes a null `dc_id`
(region-wide image store) and NPEs before this compare is reached.
--
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]