Skip to content

Commit 278293b

Browse files
mgr/vol: log in case path goes in missing in async_cloner.py
Add a log entry in case the source and/or destination path goes missing for a clone operation. Fixes: https://tracker.ceph.com/issues/71019 Signed-off-by: Rishabh Dave <[email protected]>
1 parent 359277b commit 278293b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/pybind/mgr/volumes/fs/async_cloner.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,20 @@ def set_quota_on_clone(fs_handle, clone_volumes_pair):
177177
quota = int(fs_handle.getxattr(src_path, 'ceph.quota.max_bytes').decode('utf-8'))
178178
except cephfs.NoData:
179179
pass
180+
except cephfs.ObjectNotFound:
181+
log.info('set_quota_on_clone(): getxattr failed because source path '
182+
f'"{src_path}" has gone missing')
183+
raise
180184

181185
if quota is not None:
182186
try:
183187
fs_handle.setxattr(dst_path, 'ceph.quota.max_bytes', str(quota).encode('utf-8'), 0)
184188
except cephfs.InvalidValue:
185189
raise VolumeException(-errno.EINVAL, "invalid size specified: '{0}'".format(quota))
190+
except cephfs.ObjectNotFound:
191+
log.info('set_quota_on_clone(): getxattr failed because destination path '
192+
f'"{dst_path}" has gone missing')
193+
raise
186194
except cephfs.Error as e:
187195
raise VolumeException(-e.args[0], e.args[1])
188196

@@ -191,12 +199,20 @@ def set_quota_on_clone(fs_handle, clone_volumes_pair):
191199
quota_files = int(fs_handle.getxattr(src_path, 'ceph.quota.max_files').decode('utf-8'))
192200
except cephfs.NoData:
193201
pass
202+
except cephfs.ObjectNotFound:
203+
log.info('set_quota_on_clone(): getxattr failed because source path '
204+
f'"{src_path}" has gone missing')
205+
raise
194206

195207
if quota_files is not None:
196208
try:
197209
fs_handle.setxattr(dst_path, 'ceph.quota.max_files', str(quota_files).encode('utf-8'), 0)
198210
except cephfs.InvalidValue:
199211
raise VolumeException(-errno.EINVAL, "invalid file count specified: '{0}'".format(quota_files))
212+
except cephfs.ObjectNotFound:
213+
log.info('set_quota_on_clone(): getxattr failed because destination path '
214+
f'"{dst_path}" has gone missing')
215+
raise
200216
except cephfs.Error as e:
201217
raise VolumeException(-e.args[0], e.args[1])
202218

0 commit comments

Comments
 (0)