Skip to content

fix: resolve account for SNAPSHOT data objects in DownloadListener (fixes #13900) - #13929

Open
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix-snapshot-account-lookup-13900
Open

fix: resolve account for SNAPSHOT data objects in DownloadListener (fixes #13900)#13929
waterWang wants to merge 1 commit into
apache:mainfrom
waterWang:fix-snapshot-account-lookup-13900

Conversation

@waterWang

Copy link
Copy Markdown

Fixes

Fixes #13900

Root cause

DownloadListener.getAccountIdForDataObject() only handles TEMPLATE and VOLUME data object types. For SNAPSHOT data objects it falls through and returns null, so checkAndUpdateResourceLimits() calls _accountMgr.getAccount(null) — the account lookup fails, resource-limit accounting is skipped, the download is never marked successful, and copySnapshot between zones times out after ~90s even though the destination SSVM already finished downloading the snapshot files.

Fix

Add a SNAPSHOT branch to getAccountIdForDataObject() that looks up the snapshot's account via SnapshotDao.findById(), mirroring the existing TEMPLATE/VOLUME branches. The downloaded snapshot files are already present on the destination store; only the account attribution and resource-count update were missing.

Testing

  • mvn -pl server -am compile passes
  • No new dependencies — SnapshotDao is already used elsewhere in the server module

…ataObject

Fixes apache#13900: copySnapshot between zones fails with
"Timeout waiting for response from storage host" when the account
lookup returns null for SNAPSHOT data objects.

Signed-off-by: waterWang <waterwang@proton.me>
@DaanHoogland

Copy link
Copy Markdown
Contributor

code looks good @waterWang , but this should go on the 4.20 branch as it is valid for older LTS versions as well.

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.41%. Comparing base (d45d481) to head (2940f17).
⚠️ Report is 1 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (d45d481) and HEAD (2940f17). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (d45d481) HEAD (2940f17)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               main   #13929       +/-   ##
=============================================
- Coverage     19.65%    3.41%   -16.25%     
=============================================
  Files          6368      487     -5881     
  Lines        574913    41862   -533051     
  Branches      70352     7912    -62440     
=============================================
- Hits         113024     1429   -111595     
+ Misses       449616    40233   -409383     
+ Partials      12273      200    -12073     
Flag Coverage Δ
uitests 3.41% <ø> (ø)
unittests ?

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.

@kiranchavala

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@kiranchavala a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 18937

Comment on lines +282 to +284
} else if (DataObjectType.SNAPSHOT.equals(object.getType())) {
SnapshotVO s = _snapshotDao.findById(object.getId());
return s != null ? s.getAccountId() : null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if (DataObjectType.SNAPSHOT.equals(object.getType())) {
SnapshotVO s = _snapshotDao.findById(object.getId());
return s != null ? s.getAccountId() : null;
} else if (DataObjectType.SNAPSHOT.equals(object.getType())) {
SnapshotVO s = _snapshotDao.findById(object.getId());
return s != null ? s.getAccountId() : null;
}

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.

copySnapshot between zones fails with: Timeout waiting for response from storage host

4 participants