@@ -3079,6 +3079,7 @@ int RadosObject::restore_obj_from_cloud(Bucket* bucket,
30793079 CephContext* cct,
30803080 std::optional<uint64_t > days,
30813081 bool & in_progress,
3082+ uint64_t & size,
30823083 const DoutPrefixProvider* dpp,
30833084 optional_yield y)
30843085{
@@ -3154,7 +3155,7 @@ int RadosObject::restore_obj_from_cloud(Bucket* bucket,
31543155 * avoid any races */
31553156 ret = store->getRados ()->restore_obj_from_cloud (tier_ctx, *rados_ctx,
31563157 bucket->get_info (), get_obj (),
3157- tier_config, days, in_progress, dpp, y);
3158+ tier_config, days, in_progress, size, dpp, y);
31583159
31593160 if (ret < 0 ) { // failed to restore
31603161 ldpp_dout (dpp, 0 ) << " Restoring object(" << get_key () << " ) from the cloud endpoint(" << endpoint << " ) failed, ret=" << ret << dendl;
@@ -3364,13 +3365,26 @@ int RadosObject::handle_obj_expiry(const DoutPrefixProvider* dpp, optional_yield
33643365 attrs[RGW_ATTR_INTERNAL_MTIME] = std::move (bl);
33653366 }
33663367 const req_context rctx{dpp, y, nullptr };
3367- return obj_op.write_meta (0 , 0 , attrs, rctx, head_obj->get_trace (), false );
3368+ ret = obj_op.write_meta (0 , 0 , attrs, rctx, head_obj->get_trace (), false );
3369+
3370+ // send notification in case the temporary copy of restored obj is expired
3371+ if (!ret) { // send notification
3372+ string etag;
3373+ attr_iter = attrs.find (RGW_ATTR_ETAG);
3374+ if (attr_iter != attrs.end ()) {
3375+ etag = rgw_bl_str (attr_iter->second );
3376+ }
3377+ store->get_rgwrestore ()->send_notification (dpp, store, this , bucket, etag, 0 ,
3378+ get_obj ().key .instance ,
3379+ {rgw::notify::ObjectRestoreExpired}, y);
3380+
3381+ }
33683382 } catch (const buffer::end_of_buffer&) {
33693383 // ignore empty manifest; it's not cloud-tiered
33703384 } catch (const std::exception& e) {
33713385 }
33723386 }
3373- return 0 ;
3387+ return ret ;
33743388 }
33753389 }
33763390 // object is not restored/temporary; go for regular deletion
0 commit comments