GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Bugfix/cstackex 327-Concurrent iSCSI VM deployment fails intermittently: post-clone LUN resize returns 404 by sp16743 · Pull Request #118 · NetApp/cloudstack Conversation
|
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 24.82% |
| Branch coverage | 18.97% |
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (sizeInBytes <= 0) { | ||
| throw new CloudRuntimeException("Failed to resize Lun, invalid size " + sizeInBytes); | ||
| } | ||
| String authHeader = OntapStorageUtils.generateAuthHeader(storage.getUsername(), storage.getPassword()); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
instead of adding the retry logic here, during lun clone return the job response and poll for that job to get complete and perform the resize later
Sorry, something went wrong.
There was an error while loading. Please reload this page.
62c8ec7 to
182b07b
Compare
There was an error while loading. Please reload this page.
🔴 Test Coverage Grade:
|
| Metric | Value |
|---|---|
| Line coverage | 25.83% |
| Branch coverage | 20.12% |
| Grade | Line Coverage | Meaning |
|---|---|---|
| 🟢 A | ≥ 80% | Excellent - this code sleeps well at night 😴 |
| 🟡 B | 60-79% | Good - almost there, don't stop now 😉 |
| 🟠 C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags 😬 |
| 🔴 D | 20-39% | Marginal - boldly shipping where no test has gone before 🖖 |
| ⛔ F | < 20% | Failing - tests? what tests? 🔥 |
Branch coverage is shown as a secondary signal. Grade is determined by line coverage.
View full Actions run
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| } | ||
| } | ||
| throw new CloudRuntimeException("Cloned Lun uuid was not visible for: " + lunUuid); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If lun uuid itself is not visible, what's the point of logging lunUuid? 😆
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes, there is no point. I have changed it.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| String authHeader = OntapStorageUtils.generateAuthHeader(storage.getUsername(), storage.getPassword()); | ||
| OntapResponse<Lun> clonedLun = sanFeignClient.createLun(authHeader, true, lunRequest); | ||
| if (clonedLun == null || CollectionUtils.isEmpty(clonedLun.getRecords())) { | ||
| OntapResponse<Lun> created = sanFeignClient.createLun(authHeader, true, lunRequest); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
change the variable name to clonedLun
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Done
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| OntapResponse<Lun> clonedLun = sanFeignClient.createLun(authHeader, true, lunRequest); | ||
| if (clonedLun == null || CollectionUtils.isEmpty(clonedLun.getRecords())) { | ||
| OntapResponse<Lun> created = sanFeignClient.createLun(authHeader, true, lunRequest); | ||
| if (created == null || created.getRecords() == null || created.getRecords().isEmpty() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
use collectionUtils/Stringutils for null or empty check
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Changed it now
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| } | ||
| Lun lun = clonedLun.getRecords().get(0); | ||
| String lunUuid = created.getRecords().get(0).getUuid(); | ||
| Lun lun = getLunByUuidUntilVisible(authHeader, lunUuid, lunRequest.getName()); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
what if the get lun call failed, cloned lun will. still exists and retry will see the duplicate lun
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added it.The cloned LUN is deleted ,so a subsequent CloudStack retry does not encounter a duplicate LUN name.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| for (int attempt = 1; attempt <= OntapStorageConstants.ONTAP_LUN_CLONE_GET_MAX_RETRIES; attempt++) { | ||
| try { | ||
| Lun lun = sanFeignClient.getLunByUUID(authHeader, lunUuid); | ||
| if (lun != null) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
we can not decode based on lun != null condition that lun is visible.
return the get response record instead
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Changed it.The code now uses the collection GET with the LUN UUID, verifies that the response contains a record, and returns that record instead of relying on lun != null.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| public static final int ONTAP_FLEXVOL_JOB_POLL_INTERVAL_MS = 2000; | ||
| public static final int ONTAP_FLEXVOL_RESOLVE_MAX_RETRIES = 30; | ||
| /** GET-by-UUID retries after LUN clone response. */ | ||
| public static final int ONTAP_LUN_CLONE_GET_MAX_RETRIES = 5; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this interval and no of retries are less for clone
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Changed the retries to 10
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Requested changes must be addressed to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.