-
Notifications
You must be signed in to change notification settings - Fork 8
fix(linstorvolumemanager): don't allow InUse volumes to be deleted #106
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
base: 3.2.12-8.3
Are you sure you want to change the base?
Conversation
2e28b7a to
a86786c
Compare
a86786c to
e7af4ae
Compare
e7af4ae to
91916fe
Compare
91916fe to
a90db03
Compare
Millefeuille42
left a comment
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.
Not blocking. Other than that, LGTM.
a90db03 to
e85e3e9
Compare
66c7c8e to
aaaab27
Compare
e85e3e9 to
04276e8
Compare
| self._ensure_volume_exists(volume_uuid) | ||
| self.ensure_volume_is_not_locked(volume_uuid) | ||
|
|
||
| is_volume_in_use = any(node["in-use"] for node in self.get_resource_info(volume_uuid)["nodes"].values()) |
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.
Honestly, I don't remember exactly what we said, but: Honestly, I don't remember exactly what we said, but: how many seconds do you estimate the cost of this call to be? For example, if we have 500 resources in the database?
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.
It was 0.00475s for a 3 nodes linstor setup
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.
After further testing, we can confirm that get_resource_info gets called before anyway.
Calling the linstor api with filters is 10 times slower compared to just looking up at our cache.
Fix some typo in docstring Signed-off-by: Antoine Bartuccio <antoine.bartuccio@vates.tech>
04276e8 to
336c03f
Compare
|
All good :) |
336c03f to
8f06d53
Compare
Check for usage status before deleting a linstor volume and raise an appropriate error if this happens Signed-off-by: Antoine Bartuccio <antoine.bartuccio@vates.tech>
8f06d53 to
aa72d44
Compare
|
@klmp200 Can you add |
Check for usage status before deleting a linstor volume and raise an appropriate error if this happens