Skip to content

Commit

Permalink
fix(linstor): check if resource is tiebreaker (#62)
Browse files Browse the repository at this point in the history
We check if a resource is already a tiebreaker before trying to delete
the resource.
If it is, we do not delete it.

Signed-off-by: Damien Thenot <damien.thenot@vates.tech>
  • Loading branch information
Nambrok authored and Wescoeur committed Jul 26, 2024
1 parent 8bf754b commit c271946
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/linstorvolumemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,13 @@ def remove_volume_if_diskless(self, volume_uuid):
volume_name = volume_properties.get(self.PROP_VOLUME_NAME)

node_name = socket.gethostname()

for resource in self._get_resource_cache().resources:
if resource.name == volume_name and resource.node_name == node_name:
if linstor.consts.FLAG_TIE_BREAKER in resource.flags:
return
break

result = self._linstor.resource_delete_if_diskless(
node_name=node_name, rsc_name=volume_name
)
Expand Down

0 comments on commit c271946

Please sign in to comment.