if (op_ret < 0)
return;
- // remove the upload obj
- int r = meta_obj->delete_object(this, s->obj_ctx, y);
+ // remove the upload meta object ; the meta object is not versioned
+ // when the bucket is, as that would add an unneeded delete marker
+ int r = meta_obj->delete_object(this, s->obj_ctx, y, true /* prevent versioning */);
if (r >= 0) {
/* serializer's exclusive lock is released */
serializer->clear_locked();
ldpp_dout(this, 1) << "ERROR: publishing notification failed, with error: " << ret << dendl;
// too late to rollback operation, hence op_ret is not set here
}
-}
+} // RGWCompleteMultipart::execute
bool RGWCompleteMultipart::check_previously_completed(const RGWMultiCompleteUpload* parts)
{
RGWObjectCtx& obj_ctx,
const RGWBucketInfo& bucket_info,
const rgw_obj& obj,
- int versioning_status,
+ int versioning_status, // versioning flags defined in enum RGWBucketFlags
uint16_t bilog_flags,
const real_time& expiration_time,
rgw_zone_set *zones_trace)
struct DeleteParams {
rgw_user bucket_owner;
- int versioning_status;
- ACLOwner obj_owner; /* needed for creation of deletion marker */
+ int versioning_status; // versioning flags defined in enum RGWBucketFlags
+ ACLOwner obj_owner; // needed for creation of deletion marker
uint64_t olh_epoch;
string marker_version_id;
uint32_t bilog_flags;
RGWObjectCtx& obj_ctx,
const RGWBucketInfo& bucket_owner,
const rgw_obj& src_obj,
- int versioning_status,
+ int versioning_status, // versioning flags defined in enum RGWBucketFlags
uint16_t bilog_flags = 0,
const ceph::real_time& expiration_time = ceph::real_time(),
rgw_zone_set *zones_trace = nullptr);
virtual ~Object() = default;
- virtual int delete_object(const DoutPrefixProvider* dpp, RGWObjectCtx* obj_ctx, optional_yield y) = 0;
+ virtual int delete_object(const DoutPrefixProvider* dpp,
+ RGWObjectCtx* obj_ctx,
+ optional_yield y,
+ bool prevent_versioning = false) = 0;
virtual int delete_obj_aio(const DoutPrefixProvider* dpp, RGWObjState* astate, Completions* aio,
bool keep_index_consistent, optional_yield y) = 0;
virtual int copy_object(RGWObjectCtx& obj_ctx, User* user,
return ret;
}
-int RadosObject::delete_object(const DoutPrefixProvider* dpp, RGWObjectCtx* obj_ctx, optional_yield y)
+int RadosObject::delete_object(const DoutPrefixProvider* dpp,
+ RGWObjectCtx* obj_ctx,
+ optional_yield y,
+ bool prevent_versioning)
{
RGWRados::Object del_target(store->getRados(), bucket->get_info(), *obj_ctx, get_obj());
RGWRados::Object::Delete del_op(&del_target);
del_op.params.bucket_owner = bucket->get_info().owner;
- del_op.params.versioning_status = bucket->get_info().versioning_status();
+ del_op.params.versioning_status = prevent_versioning ? 0 : bucket->get_info().versioning_status();
return del_op.delete_obj(y, dpp);
}
}
RadosObject(RadosObject& _o) = default;
- virtual int delete_object(const DoutPrefixProvider* dpp, RGWObjectCtx* obj_ctx, optional_yield y) override;
+ virtual int delete_object(const DoutPrefixProvider* dpp, RGWObjectCtx* obj_ctx,
+ optional_yield y, bool prevent_versioning) override;
virtual int delete_obj_aio(const DoutPrefixProvider* dpp, RGWObjState* astate, Completions* aio,
bool keep_index_consistent, optional_yield y) override;
virtual int copy_object(RGWObjectCtx& obj_ctx, User* user,