]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw/cloudtier: Restore object from cloud endpoint
authorSoumya Koduri <skoduri@redhat.com>
Thu, 3 Oct 2024 02:33:20 +0000 (08:03 +0530)
committerSoumya Koduri <skoduri@redhat.com>
Thu, 3 Oct 2024 08:28:32 +0000 (13:58 +0530)
commit0e0222d0162bcb7d49f79f73311e01cd19b0248c
treeedf843410964d33e8266e129c1243540e210d667
parent4df972a1a005015d621b0f0ada61e02eb76c86ed
rgw/cloudtier: Restore object from cloud endpoint

1)Add functionality to restore cloud-transitioned objects on demand.

Current commit has below -
* Given <bucket,object>, fetch the object from the cloud endpoint.
* if days provided and > 0, the restore is marked temporary with expiry date.
* Without <days>, it is marked as permanent restore.

2)Use ObjectExpirer/delete_at attr to delete temp objects

For temporarily restored objects, set delete_at attr to the expiration time.
This will add those objects to ObjectExpirer list. Use LC worker thread to
scan that list and delete expired objects. By delete here, it means to delete
restored object data and reset HEAD object as Cloud-transitioned object as it
was before restore.

In addition below changes are done -
* If temporary, object is still marked RGWObj::CloudTiered and mtime is set same as
transition time.
* If permanent, object is marked RGWObj::Main and mtime is set to restore time (now()).
* rgw_restore_debug_interval option added to set configure restore Days (similar to rgw_lc_debug_interval)

There is an issue with ObjectExpirer code where in if an object is added
to ObjectExpirer list and is re-written, it is not deleted from the expirer list
and hence the new object may get deleted. Fixed the same and also addressed
minor review comments.

3)Design doc added

4) ObjCategory should be set to CloudTiered only for cloud-transitioned
objects and temporarily restored objects. Permanent copies are to be
treated as regular objects.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
20 files changed:
src/common/options/rgw.yaml.in
src/doc/rgw/cloud-restore.md [new file with mode: 0644]
src/rgw/driver/daos/rgw_sal_daos.cc
src/rgw/driver/daos/rgw_sal_daos.h
src/rgw/driver/posix/rgw_sal_posix.cc
src/rgw/driver/posix/rgw_sal_posix.h
src/rgw/driver/rados/rgw_lc_tier.cc
src/rgw/driver/rados/rgw_lc_tier.h
src/rgw/driver/rados/rgw_object_expirer_core.cc
src/rgw/driver/rados/rgw_rados.cc
src/rgw/driver/rados/rgw_rados.h
src/rgw/driver/rados/rgw_sal_rados.cc
src/rgw/driver/rados/rgw_sal_rados.h
src/rgw/rgw_common.h
src/rgw/rgw_lc.cc
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_sal.h
src/rgw/rgw_sal_filter.cc
src/rgw/rgw_sal_filter.h
src/rgw/rgw_sal_store.h