From 1eb0623d6b7dee653c7529a38b8f907185107d33 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Fri, 12 Sep 2025 12:59:22 +0530 Subject: [PATCH] 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 --- src/rgw/rgw_restore.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_restore.cc b/src/rgw/rgw_restore.cc index 2d9a61d077758..78120eba01b64 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(); -- 2.39.5