Skip to content

Fix stray semicolon in SnapshotDataFactoryImpl.getSnapshot zone fallb… - #14943

Open
ravening wants to merge 1 commit into
apache:mainfrom
ravening:vibe/fix-14770-snapshot-zone-96810d
Open

ravening wants to merge 1 commit into
apache:mainfrom
ravening:vibe/fix-14770-snapshot-zone-96810d

Conversation

@ravening

@ravening ravening commented Dec 2, 2026

Copy link
Copy Markdown
Member

(#14770)

Description

SnapshotDataFactoryImpl.getSnapshot(snapshotId, role, zoneId, retrieveAnySnapshotFromVolume) had a stray ; in its fallback loop, making the if a no-op: the first snapshot copy from any zone was returned instead of the one in the requested zone. Both loops also used long == Long unboxing, which NPEs when getStoreZoneId returns null. Both loops now compare null-safely with Long.valueOf(zoneId).equals(...).

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • 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)

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

Two-line comparison fix verified by inspection; getSnapshotWithRoleAndZone(id, role, zoneB) now returns null when the only copy is in zone A. Module compilation/CI runs on the PR (no JDK in the working environment).

Closes #14770

…ack (apache#14770)

### Description

`SnapshotDataFactoryImpl.getSnapshot(snapshotId, role, zoneId, retrieveAnySnapshotFromVolume)` had a stray `;` in its fallback loop, making the `if` a no-op: the first snapshot copy from any zone was returned instead of the one in the requested zone. Both loops also used `long == Long` unboxing, which NPEs when `getStoreZoneId` returns null. Both loops now compare null-safely with `Long.valueOf(zoneId).equals(...)`.

### 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)

### Bug Severity

- [ ] BLOCKER
- [ ] Critical
- [x] Major
- [ ] Minor
- [ ] Trivial

### How Has This Been Tested?

Two-line comparison fix verified by inspection; `getSnapshotWithRoleAndZone(id, role, zoneB)` now returns null when the only copy is in zone A. Module compilation/CI runs on the PR (no JDK in the working environment).

Closes apache#14770

Co-authored-by: ravening <ravening@users.noreply.github.com>

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.

Snapshot lookup by zone ignores the zone in its fallback (stray semicolon)

2 participants