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=1eb0623d6b7dee653c7529a38b8f907185107d33;p=ceph.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`. Signed-off-by: Soumya Koduri --- diff --git a/src/rgw/rgw_restore.cc b/src/rgw/rgw_restore.cc index 2d9a61d07775..78120eba01b6 100644 --- a/src/rgw/rgw_restore.cc +++ b/src/rgw/rgw_restore.cc @@ -392,7 +392,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; @@ -400,6 +399,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 @@ -632,7 +634,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();