From: Soumya Koduri Date: Fri, 12 Sep 2025 07:29:22 +0000 (+0530) Subject: rgw/restore: Mark the restore entry status as `None` first time X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a7e8eaf69f5964ee1bd864ef2eaee9f4b459b5df;p=ceph-ci.git rgw/restore: Mark the restore entry status as `None` first time While adding the restore entry to the FIFO, mark its status as `None` so that restore thread knows that the entry is being processed for the first time. Incase the restore is still in progress and the entry needs to be re-added to the queue, its status then will be marked `InProgress`. Resolves: rhbz#2312933 Signed-off-by: Soumya Koduri --- diff --git a/src/rgw/rgw_restore.cc b/src/rgw/rgw_restore.cc index ca2a8dcd69b..c63c17967d1 100644 --- a/src/rgw/rgw_restore.cc +++ b/src/rgw/rgw_restore.cc @@ -377,7 +377,6 @@ done: int Restore::process_restore_entry(RestoreEntry& entry, optional_yield y) { int ret = 0; - bool in_progress = true; std::unique_ptr bucket; std::unique_ptr obj; std::unique_ptr tier; @@ -385,6 +384,9 @@ int Restore::process_restore_entry(RestoreEntry& entry, optional_yield y) rgw::sal::RGWRestoreStatus restore_status = rgw::sal::RGWRestoreStatus::None; rgw_placement_rule target_placement; + // mark in_progress as false if the entry is being processed first time + bool in_progress = ((entry.status == rgw::sal::RGWRestoreStatus::None) ? false : true); + // Ensure its the same source zone processing temp entries as we do not // replicate temp restored copies if (days) { // temp copy @@ -617,7 +619,8 @@ int Restore::restore_obj_from_cloud(rgw::sal::Bucket* pbucket, RestoreEntry entry; entry.bucket = pbucket->get_key(); entry.obj_key = pobj->get_key(); - entry.status = rgw::sal::RGWRestoreStatus::RestoreAlreadyInProgress; + // for first time mark status as None + entry.status = rgw::sal::RGWRestoreStatus::None; entry.days = days; entry.zone_id = driver->get_zone()->get_id();