Skip to content

Commit

Permalink
rbd: reduce cluster load by avoiding rbd.list
Browse files Browse the repository at this point in the history
Fixes PL-133194
  • Loading branch information
ctheune committed Nov 19, 2024
1 parent ffd5fb7 commit b340e88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Release notes
when inventory data and real data mismatch and may shrink root images
accidentally. (PL-133166)

- rbd: fix cluster load issue due to overuse of rbd.list (PL-133194)

1.6 (2024-10-23)
----------------

Expand Down
7 changes: 5 additions & 2 deletions src/fc/qemu/hazmat/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,11 @@ def volume(self):
def exists_in_pools(self):
result = []
for pool, ioctx in self.ceph.ioctxs.items():
if self.name in self.ceph.rbd.list(ioctx):
result.append(pool)
try:
rbd.Image(ioctx, self.name)
except rbd.ImageNotFound:
continue
result.append(pool)
return result

def exists_in_pool(self):
Expand Down

0 comments on commit b340e88

Please sign in to comment.