Skip to content

Conversation

@klmp200
Copy link

@klmp200 klmp200 commented Oct 31, 2025

Check for usage status before deleting a linstor volume and raise an appropriate error if this happens

@klmp200 klmp200 requested review from Nambrok and Wescoeur October 31, 2025 12:02
@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from 2e28b7a to a86786c Compare October 31, 2025 12:05
@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from a86786c to e7af4ae Compare November 6, 2025 16:14
@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from e7af4ae to 91916fe Compare November 14, 2025 13:17
@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch 5 times, most recently from 91916fe to a90db03 Compare November 14, 2025 14:16
Copy link

@Millefeuille42 Millefeuille42 left a 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.

@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from a90db03 to e85e3e9 Compare November 17, 2025 14:24
@Wescoeur Wescoeur force-pushed the 3.2.12-8.3 branch 3 times, most recently from 66c7c8e to aaaab27 Compare December 1, 2025 23:24
@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from e85e3e9 to 04276e8 Compare December 2, 2025 09:43
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())
Copy link
Member

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?

Copy link
Author

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

Copy link
Author

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>
@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from 04276e8 to 336c03f Compare December 10, 2025 08:19
@klmp200
Copy link
Author

klmp200 commented Dec 10, 2025

All good :)

@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from 336c03f to 8f06d53 Compare December 10, 2025 08:27
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>
@klmp200 klmp200 force-pushed the linstor_protect_in_use_volume branch from 8f06d53 to aa72d44 Compare December 10, 2025 15:35
@Wescoeur
Copy link
Member

@klmp200 Can you add (#106) to the end of each commit title? I think we can rebase and merge after that. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants