-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDSTACK-9200: Fixed failed to delete snapshot if snapshot is stuck in Allocated state without any job associated with it #1282
Conversation
How do you know if there are no jobs associated with it? |
@pdube Snapshot can be in Allocated state for a split second only in normal scenarios. If it is in Allocated state for more than that time, then it simply means we are either restarting or have to restart the management server. Now if that's the case then it should have been cleaned up by storage cleanup thread during management server start if it has job associated with it. But that is not happening so it is falling in this scenario. |
Thanks! I had the same issue, retention settings for snapshots were failing because it couldn't delete two snapshots that were stuck in "allocated' state. |
@anshul1886 The fix is only for XS snapshots. What about other HVs? |
@koushik-das All hypervisor uses XenServerSnapshotStrategy so it should be applicable on all hypervisors. |
@anshul1886 I see in some other places in that file when |
@anshul1886 rebase against latest master, thanks Do you think a cleanup action of some sort be performed, as this will only delete the snapshot in database |
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 Failed tests:
Skipped tests: Passed test suits: |
@anshul1886 any idea why this hasn't been merged yet? are there concerns/issues? |
@Slair1 Its missing required reviews and tests.(We have a huge backlog. any help in code review/test run is welcome). please refer to https://cwiki.apache.org/confluence/display/CLOUDSTACK/Release+principles+for+Apache+CloudStack+4.6+and+up |
… in Allocated state without any job associated with it
1fb9b64
to
5ad183a
Compare
ACS CI BVT RunSumarry: Link to logs Folder (search by build_no): https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0 Failed tests: Skipped tests: Passed test suits: |
@@ -245,6 +245,12 @@ public boolean deleteSnapshot(Long snapshotId) { | |||
return true; | |||
} | |||
|
|||
if(snapshotVO.getState() == Snapshot.State.Allocated) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anshul1886 the code to check and remove snapshot when they are stuck in Allocated state is already in line 223 above, in the same method. Why this redundancy, is this a synchronization issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhtyd Missed that change. Closing PR now.
@anshul1886 I've left a comment, the code to check and remove snapshot on allocated state is already in that method? |
https://issues.apache.org/jira/browse/CLOUDSTACK-9200
This issue is hard to reproduce but if occurs then it may lead to account resources cleanup failures.