@@ -2899,7 +2899,6 @@ int RadosObject::restore_obj_from_cloud(Bucket* bucket,
28992899 rgw_bucket_dir_entry& o,
29002900 CephContext* cct,
29012901 RGWObjTier& tier_config,
2902- real_time& mtime,
29032902 uint64_t olh_epoch,
29042903 std::optional<uint64_t > days,
29052904 const DoutPrefixProvider* dpp,
@@ -2918,16 +2917,6 @@ int RadosObject::restore_obj_from_cloud(Bucket* bucket,
29182917 int ret = 0 ;
29192918 string src_storage_class = o.meta .storage_class ; // or take src_placement also as input
29202919
2921- // fetch mtime of the object
2922- std::unique_ptr<rgw::sal::Object::ReadOp> read_op (get_read_op ());
2923- read_op->params .lastmod = &mtime;
2924-
2925- ret = read_op->prepare (y, dpp);
2926- if (ret < 0 ) {
2927- ldpp_dout (dpp, 0 ) << " Restoring object(" << o.key << " ): read_op failed ret=" << ret << dendl;
2928- return ret;
2929- }
2930-
29312920 if (bucket_name.empty ()) {
29322921 bucket_name = " rgwx-" + zonegroup.get_name () + " -" + tier->get_storage_class () +
29332922 " -cloud-bucket" ;
@@ -2968,7 +2957,7 @@ int RadosObject::restore_obj_from_cloud(Bucket* bucket,
29682957 ret = store->getRados ()->restore_obj_from_cloud (tier_ctx, *rados_ctx,
29692958 bucket->get_info (), get_obj (), placement_rule,
29702959 tier_config,
2971- mtime, olh_epoch, days, dpp, y, flags & FLAG_LOG_OP);
2960+ olh_epoch, days, dpp, y, flags & FLAG_LOG_OP);
29722961
29732962 if (ret < 0 ) { // failed to restore
29742963 ldpp_dout (dpp, 0 ) << " Restoring object(" << o.key << " ) from the cloud endpoint(" << endpoint << " ) failed, ret=" << ret << dendl;
@@ -3140,7 +3129,7 @@ int RadosObject::handle_obj_expiry(const DoutPrefixProvider* dpp, optional_yield
31403129 RGWObjManifest *pmanifest;
31413130 pmanifest = &m;
31423131
3143- Object* head_obj = (Object*)this ;
3132+ Object* head_obj = (Object*)this ;
31443133 RGWObjTier tier_config;
31453134 m.get_tier_config (&tier_config);
31463135
@@ -3151,12 +3140,21 @@ int RadosObject::handle_obj_expiry(const DoutPrefixProvider* dpp, optional_yield
31513140 pmanifest->set_obj_size (0 );
31523141 obj_op.meta .manifest = pmanifest;
31533142
3143+ auto v_iter = attrs.find (RGW_ATTR_RESTORE_VERSIONED_EPOCH);
3144+ if (v_iter != attrs.end ()) {
3145+ uint64_t versioned_epoch;
3146+ using ceph::decode;
3147+ decode (versioned_epoch, v_iter->second );
3148+ obj_op.meta .olh_epoch = versioned_epoch;
3149+ }
3150+
31543151 // erase restore attrs
31553152 attrs.erase (RGW_ATTR_RESTORE_STATUS);
31563153 attrs.erase (RGW_ATTR_RESTORE_TYPE);
31573154 attrs.erase (RGW_ATTR_RESTORE_TIME);
31583155 attrs.erase (RGW_ATTR_RESTORE_EXPIRY_DATE);
31593156 attrs.erase (RGW_ATTR_CLOUDTIER_STORAGE_CLASS);
3157+ attrs.erase (RGW_ATTR_RESTORE_VERSIONED_EPOCH);
31603158
31613159 bufferlist bl;
31623160 bl.append (tier_config.name );
0 commit comments