fix: resolve account for SNAPSHOT data objects in DownloadListener (fixes #13900) - #13929
fix: resolve account for SNAPSHOT data objects in DownloadListener (fixes #13900)#13929waterWang wants to merge 1 commit into
Conversation
…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>
|
code looks good @waterWang , but this should go on the 4.20 branch as it is valid for older LTS versions as well. |
Codecov Report✅ All modified and coverable lines are covered by tests.
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
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:
|
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 18937 |
| } else if (DataObjectType.SNAPSHOT.equals(object.getType())) { | ||
| SnapshotVO s = _snapshotDao.findById(object.getId()); | ||
| return s != null ? s.getAccountId() : null; |
There was a problem hiding this comment.
| } 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; | |
| } |
Fixes
Fixes #13900
Root cause
DownloadListener.getAccountIdForDataObject()only handlesTEMPLATEandVOLUMEdata object types. ForSNAPSHOTdata objects it falls through and returnsnull, socheckAndUpdateResourceLimits()calls_accountMgr.getAccount(null)— the account lookup fails, resource-limit accounting is skipped, the download is never marked successful, andcopySnapshotbetween zones times out after ~90s even though the destination SSVM already finished downloading the snapshot files.Fix
Add a
SNAPSHOTbranch togetAccountIdForDataObject()that looks up the snapshot's account viaSnapshotDao.findById(), mirroring the existingTEMPLATE/VOLUMEbranches. 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 compilepassesSnapshotDaois already used elsewhere in the server module