Skip to content

rgw/cloud-restore [PART2] : Add Restore support from Glacier/Tape cloud endpoints#62713

Merged
soumyakoduri merged 6 commits intoceph:mainfrom
soumyakoduri:wip-skoduri-restore-glacier
Jul 7, 2025
Merged

rgw/cloud-restore [PART2] : Add Restore support from Glacier/Tape cloud endpoints#62713
soumyakoduri merged 6 commits intoceph:mainfrom
soumyakoduri:wip-skoduri-restore-glacier

Conversation

@soumyakoduri
Copy link
Contributor

@soumyakoduri soumyakoduri commented Apr 7, 2025

This PR is a continuation of #61745. With this update, we now support restoring objects from Glacier-like cloud endpoints that have longer restore times — for example, AWS Glacier Flexible Retrieval with restore type: Standard.

Summary of changes

  1. Refactored existing restore code to consolidate and move all restore processing into rgw_restore* file/class
  2. This new class can now define restore state to be stored and processed asynchronously by worker thread.
  3. The RESTORE class methods are abstracted to be used by all SALs similar to LC
  4. for SAL_RADOS, FIFO is used to store and read restore requests state

Currently, this PR handles storing state of restore requests sent to cloud-glacier tier-type which need async processing.
The changes are tested with AWS Glacier Flexible Retrieval with tier_type Expedited and Standard.

TODO: (pending items)

  • Store the restore state of all regular requests too so that they can be retried post RGW service restarts.
  • optimize the code further to avoid using serializer while processing restore entries

Fixes: https://tracker.ceph.com/issues/70628
Signed-off-by: Soumya Koduri skoduri@redhat.com

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

@github-actions
Copy link

github-actions bot commented Apr 7, 2025

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@soumyakoduri soumyakoduri requested review from adamemerson, dang, mattbenjamin and thotz and removed request for a team April 7, 2025 17:09
int num_objs;
librados::IoCtx& ioctx;
using centries = std::vector<ceph::buffer::list>;
ceph::containers::tiny_vector<LazyFIFO> fifos;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamemerson I used LazyFIFO (from rgw_log_backing.h) to store restore entries similar to datalog. After rebase I noticed that you updated LazyFIFO to use neorados. Do you suggest I update this RadosRestore too with neorados or do I need to create new wrapper for FIFO class ?

@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch from 1616429 to b5b5c7d Compare June 7, 2025 17:12
@soumyakoduri soumyakoduri changed the title [WIP]rgw/cloud-restore [PART2] : Add Restore support from Glacier/Tape cloud endpoints rgw/cloud-restore [PART2] : Add Restore support from Glacier/Tape cloud endpoints Jun 7, 2025
@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch from b5b5c7d to 985d81a Compare June 9, 2025 06:46
@soumyakoduri
Copy link
Contributor Author

jenkins test make check arm64

@soumyakoduri
Copy link
Contributor Author

jenkins test signed

@soumyakoduri
Copy link
Contributor Author

@mattbenjamin @adamemerson @dang @thotz ..This PR is now ready and contains all the commits merged into downstream till now along with one additional commit (the top commit [rgw/restore: Update to neorados FIFO routines] ) which handles the changes needed to use new neorados/FIFO routines in the upstream.

Please review.

for (auto i=0; i < num_objs; i++) {
std::unique_ptr<rgw::cls::fifo::FIFO> fifo_tmp;
ret = rgw::cls::fifo::FIFO::create(dpp, ioctx, obj_names[i], &fifo_tmp, y);
std::unique_ptr<fifo::FIFO> fifo_tmp;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ret is no longer used in this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaned this up.


return 1;
}
return 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for better readablity need to move return 1 to if condition

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we cannot return true until all the shards are processed and are found empty .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

done:
lock.unlock();

return 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we ignoring ret values intentionally here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks..addressed it.

Copy link
Contributor

@thotz thotz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor suggestion regarding handling of ret values in various places

@adamemerson adamemerson self-assigned this Jun 10, 2025
@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch 3 times, most recently from a6b1efd to c4f1305 Compare June 11, 2025 20:04
Copy link
Contributor

@thotz thotz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch 2 times, most recently from 342130f to aad3024 Compare June 27, 2025 18:10
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch from aad3024 to 22e8eff Compare June 30, 2025 18:22
@soumyakoduri
Copy link
Contributor Author

@soumyakoduri
Copy link
Contributor Author

@adamemerson @thotz .. I addressed review comments and rebase conflicts.. kindly review

@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch from 22e8eff to 6a8631d Compare July 4, 2025 06:03
@soumyakoduri
Copy link
Contributor Author

jenkins test docs

@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch from 6a8631d to d4dbb6f Compare July 4, 2025 07:21
@soumyakoduri
Copy link
Contributor Author

jenkins test make check

…cier/Tape endpoint

Restoration of objects from certain cloud services (like Glacier/Tape) could
take significant amount of time (even days). Hence store the state of such restore requests
and periodically process them.

Brief summary of changes

* Refactored existing restore code to consolidate and move all restore processing into rgw_restore* file/class

* RGWRestore class is defined to manage the restoration of objects.

* Lastly, for SAL_RADOS, FIFO is used to store and read restore entries.

Currently, this PR handles storing state of restore requests sent to cloud-glacier tier-type which need async processing.
The changes are tested with AWS Glacier Flexible Retrieval with tier_type Expedited and Standard.

Reviewed-by: Matt Benjamin <mbenjamin@redhat.com>
Reviewed-by: Adam Emerson <aemerson@redhat.com>
Reviewed-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
Reviewed-by: Daniel Gryniewicz <dang@redhat.com>

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
In case adding restore entry to FIFO fails, reset the `restore_status`
of that object as "RestoreFailed" so that restore process can be
retried from the end S3 user.

Reviewed-by: Adam Emerson <aemerson@redhat.com>
Reviewed-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
In addition, added some more debug statements and done code cleanup

Reviewed-by: Adam Emerson <aemerson@redhat.com>
Reviewed-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-by: Adam Emerson <aemerson@redhat.com>
Reviewed-by: Matt Benjamin <mbenjamin@redhat.com>

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Use new neorados/FIFO routines to store restore state.

Note: Old librados ioctx is also still retained as it is needed
by RestoreRadosSerializer.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
@soumyakoduri soumyakoduri force-pushed the wip-skoduri-restore-glacier branch from d4dbb6f to a981b4c Compare July 4, 2025 12:48

void encode(bufferlist& bl) const {
ENCODE_START(16, 1, bl);
ENCODE_START(17, 1, bl);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbodley @adamemerson .. while trying to backport these changes to tentacle, I observed that the ENCODE/DECODE version will be 16 for restore_pool (same as in downstream 8.1 codebase) in that branch as opposed to 17 in main . Would this cause any issue during upgrade later from tentacle to next upcoming release?

To resolve it, can we include "restore_pool" along with "dedup_pool" in the same ENCODE version i.e, 16 here in this PR?

Copy link
Contributor

@cbodley cbodley Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @soumyakoduri

upstream squid is on the v15 encoding and has up to group_pool: https://github.com/ceph/ceph/blob/squid/src/rgw/driver/rados/rgw_zone.h#L156-L184

i see that #64264 is pending backport to tentacle, adding v16 for dedup_pool (cc @benhanokh)

does 8.1 add dedup_pool for v16 too? if not, we'd probably need tentacle to include a v16 with only restore_pool to match 8.1, and bump the dedup_pool change to v17 so we could support upgrade from 8.1 to 9

Copy link
Contributor Author

@soumyakoduri soumyakoduri Jul 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cbodley ...

yes.. 8.1 doesn't have dedup_pool. Its just restore_pool in v16.
So shall I make changes to reverse the version (i.e, v16 for restore_pool and v17 for dedup_pool ) in main and backport changes in the same order to tentacle?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#64360 is the backport of this PR to tentacle..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#64360 is the backport of this PR to tentacle and PR64361 fixes the versions in main

@soumyakoduri
Copy link
Contributor Author

jenkins make check arm64

@soumyakoduri
Copy link
Contributor Author

jenkins test make check arm64

@soumyakoduri soumyakoduri merged commit a79e02a into ceph:main Jul 7, 2025
13 checks passed
@ivancich
Copy link
Member

ivancich commented Jul 7, 2025

@soumyakoduri
Copy link
Contributor Author

@soumyakoduri @adamemerson @thotz -- This PR seems to be causing testing failures.

https://qa-proxy.ceph.com/teuthology/anuchaithra-2025-07-04_16:46:39-rgw-wip-anrao2-testing-2025-07-04-1031-distro-default-smithi/8369939/teuthology.log

@ivancich , as you had mentioned in the slack, these tests were run before this PR was merged. So this PR hasn't caused any regressions. Moreover, teuthology tests had passed when tested with this PR changes (#62713 (comment)).

I am unsure at the moment why all the restore tests had failed in the log link you pasted above. I have requested Anuchaitra to rerun the tests and see if it consistently fails. Probably any PR in that testing branch may be causing the failures.

@soumyakoduri soumyakoduri deleted the wip-skoduri-restore-glacier branch March 6, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants