}; /* lc_op_ctx */
-static bool pass_size_limit_checks(const DoutPrefixProvider *dpp, lc_op_ctx& oc) {
+static bool pass_size_limit_checks(const DoutPrefixProvider *dpp,
+ optional_yield y, lc_op_ctx& oc) {
const auto& op = oc.op;
if (op.size_gt || op.size_lt) {
auto& o = oc.o;
std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(o.key);
- ret = obj->load_obj_state(dpp, null_yield, true);
+ ret = obj->load_obj_state(dpp, y, true);
if (ret < 0) {
return false;
}
static std::string lc_req_id = "0";
static void send_notification(const DoutPrefixProvider* dpp,
+ optional_yield y,
rgw::sal::Driver* driver,
rgw::sal::Object* obj,
rgw::sal::Bucket* bucket,
// notification supported only for RADOS driver for now
auto notify = driver->get_notification(
dpp, obj, nullptr, event_types, bucket, lc_id,
- const_cast<std::string&>(bucket->get_tenant()), lc_req_id, null_yield);
+ const_cast<std::string&>(bucket->get_tenant()), lc_req_id, y);
int ret = notify->publish_reserve(dpp, nullptr);
if (ret < 0) {
}
static int remove_expired_obj(const DoutPrefixProvider* dpp,
- lc_op_ctx& oc,
+ optional_yield y, lc_op_ctx& oc,
bool remove_indeed,
const rgw::notify::EventTypeList& event_types) {
int ret{0};
string etag;
auto obj = oc.bucket->get_object(obj_key);
- ret = obj->load_obj_state(dpp, null_yield, true);
+ ret = obj->load_obj_state(dpp, y, true);
if (ret < 0) {
/* for delete markers, we expect load_obj_state() to "fail"
* with -ENOENT */
uint32_t flags = (!remove_indeed || !zonegroup_lc_check(dpp, oc.driver->get_zone()))
? rgw::sal::FLAG_LOG_OP : 0;
- ret = del_op->delete_obj(dpp, null_yield, flags);
+ ret = del_op->delete_obj(dpp, y, flags);
if (ret < 0) {
ldpp_dout(dpp, 1) <<
fmt::format("ERROR: {} failed, with error: {}", __func__, ret) << dendl;
} else {
if (have_notify) {
- send_notification(dpp, driver, obj.get(), oc.bucket, etag, size,
+ send_notification(dpp, y, driver, obj.get(), oc.bucket, etag, size,
version_id, event_types);
}
}
params.ns = RGW_OBJ_NS_MULTIPART;
params.access_list_filter = MultipartMetaFilter;
- auto pf = [&](RGWLC::LCWorker *wk, WorkQ *wq, WorkItem &wi) {
+ auto pf = [&](RGWLC::LCWorker *wk, WorkQ *wq, WorkItem &wi, optional_yield y) {
int ret{0};
auto wt = std::get<std::tuple<lc_op, rgw_bucket_dir_entry>>(wi);
auto& [rule, obj] = wt;
auto sal_obj = target->get_object(key);
string etag;
- ret = sal_obj->load_obj_state(this, null_yield, true);
+ ret = sal_obj->load_obj_state(this, y, true);
if (ret < 0) {
return ret;
}
}
auto size = sal_obj->get_size();
- ret = mpu->abort(this, cct, null_yield);
+ ret = mpu->abort(this, cct, y);
if (ret == 0) {
const auto event_type = rgw::notify::ObjectExpirationAbortMPU;
- send_notification(this, driver, sal_obj.get(), target, etag, size,
+ send_notification(this, y, driver, sal_obj.get(), target, etag, size,
obj.key.instance, {event_type});
if (perfcounter) {
perfcounter->inc(l_rgw_lc_abort_mpu, 1);
is_expired = obj_has_expired(dpp, oc.cct, mtime, op.expiration, exp_time);
}
- auto size_check_p = pass_size_limit_checks(dpp, oc);
+ auto size_check_p = pass_size_limit_checks(dpp, y, oc);
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key << ": is_expired="
<< (int)is_expired << " size_check_p: "
return is_expired && size_check_p;
}
- int process(lc_op_ctx& oc) override {
+ int process(lc_op_ctx& oc, optional_yield y) override {
auto& o = oc.o;
int r;
if (o.is_delete_marker()) {
r = remove_expired_obj(
- oc.dpp, oc, true,
+ oc.dpp, y, oc, true,
{rgw::notify::ObjectExpirationDeleteMarker,
rgw::notify::LifecycleExpirationDeleteMarkerCreated});
if (r < 0) {
<< " " << oc.wq->thr_name() << dendl;
} else {
/* ! o.is_delete_marker() */
- r = remove_expired_obj(oc.dpp, oc, !oc.bucket->versioning_enabled(),
+ r = remove_expired_obj(oc.dpp, y, oc, !oc.bucket->versioning_enabled(),
{rgw::notify::ObjectExpirationCurrent,
rgw::notify::LifecycleExpirationDelete});
if (r < 0) {
int expiration = oc.op.noncur_expiration;
bool is_expired = obj_has_expired(dpp, oc.cct, oc.effective_mtime, expiration,
exp_time);
- auto size_check_p = pass_size_limit_checks(dpp, oc);
+ auto size_check_p = pass_size_limit_checks(dpp, y, oc);
auto newer_noncurrent_p = (oc.num_noncurrent > oc.op.newer_noncurrent);
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key << ": is_expired="
return is_expired &&
(oc.num_noncurrent > oc.op.newer_noncurrent) && size_check_p &&
- pass_object_lock_check(oc.driver, oc.obj.get(), dpp);
+ pass_object_lock_check(oc.driver, oc.obj.get(), dpp, y);
}
- int process(lc_op_ctx& oc) override {
+ int process(lc_op_ctx& oc, optional_yield y) override {
auto& o = oc.o;
- int r = remove_expired_obj(oc.dpp, oc, true,
+ int r = remove_expired_obj(oc.dpp, y, oc, true,
{rgw::notify::LifecycleExpirationDelete,
rgw::notify::ObjectExpirationNoncurrent});
if (r < 0) {
return true;
}
- int process(lc_op_ctx& oc) override {
+ int process(lc_op_ctx& oc, optional_yield y) override {
auto& o = oc.o;
- int r = remove_expired_obj(oc.dpp, oc, true,
+ int r = remove_expired_obj(oc.dpp, y, oc, true,
{rgw::notify::ObjectExpirationDeleteMarker,
rgw::notify::LifecycleExpirationDeleteMarkerCreated});
if (r < 0) {
is_expired = obj_has_expired(dpp, oc.cct, mtime, transition.days, exp_time);
}
- auto size_check_p = pass_size_limit_checks(dpp, oc);
+ auto size_check_p = pass_size_limit_checks(dpp, y, oc);
ldpp_dout(oc.dpp, 20) << __func__ << "(): key=" << o.key << ": is_expired="
<< is_expired << " " << " size_check_p: "
*/
if (! oc.bucket->versioning_enabled()) {
ret =
- remove_expired_obj(oc.dpp, oc, true, {/* no delete notify expected */});
+ remove_expired_obj(oc.dpp, y, oc, true, {/* no delete notify expected */});
ldpp_dout(oc.dpp, 20) << "delete_tier_obj Object(key:" << oc.o.key
<< ") not versioned flags: " << oc.o.flags << dendl;
} else {
/* versioned */
if (oc.o.is_current() && !oc.o.is_delete_marker()) {
- ret = remove_expired_obj(oc.dpp, oc, false, {/* no delete notify expected */});
+ ret = remove_expired_obj(oc.dpp, y, oc, false, {/* no delete notify expected */});
ldpp_dout(oc.dpp, 20) << "delete_tier_obj Object(key:" << oc.o.key
<< ") current & not delete_marker"
<< " versioned_epoch: " << oc.o.versioned_epoch
<< "flags: " << oc.o.flags << dendl;
} else {
- ret = remove_expired_obj(oc.dpp, oc, true,
+ ret = remove_expired_obj(oc.dpp, y, oc, true,
{/* no delete notify expected */});
ldpp_dout(oc.dpp, 20)
<< "delete_tier_obj Object(key:" << oc.o.key << ") not current "
return ret;
}
- int transition_obj_to_cloud(lc_op_ctx& oc) {
+ int transition_obj_to_cloud(lc_op_ctx& oc, optional_yield y) {
int ret{0};
/* If CurrentVersion object & bucket has versioning enabled, remove it &
* create delete marker */
auto& obj = oc.obj;
string etag;
- ret = obj->load_obj_state(oc.dpp, null_yield, true);
+ ret = obj->load_obj_state(oc.dpp, y, true);
if (ret < 0) {
return ret;
}
ret = oc.obj->transition_to_cloud(oc.bucket, oc.tier.get(), oc.o,
oc.env.worker->get_cloud_targets(),
- oc.cct, !delete_object, oc.dpp,
- null_yield);
+ oc.cct, !delete_object, oc.dpp, y);
if (ret < 0) {
return ret;
} else {
} else {
event_types.push_back(rgw::notify::ObjectTransitionNonCurrent);
}
- send_notification(oc.dpp, oc.driver, obj.get(), oc.bucket, etag, size,
+ send_notification(oc.dpp, y, oc.driver, obj.get(), oc.bucket, etag, size,
oc.o.key.instance, event_types);
}
return 0;
}
- int process(lc_op_ctx& oc) override {
+ int process(lc_op_ctx& oc, optional_yield y) override {
auto& o = oc.o;
int r;
auto& obj = oc.obj;
string etag;
- r = obj->load_obj_state(oc.dpp, null_yield, true);
+ r = obj->load_obj_state(oc.dpp, y, true);
if (r < 0) {
ldpp_dout(oc.dpp, 0) <<
fmt::format("ERROR: get_obj_state() failed on transition of object k={} error r={}",
oc.driver->get_notification(
oc.dpp, obj.get(), nullptr, event_types, bucket, lc_id,
const_cast<std::string&>(oc.bucket->get_tenant()), lc_req_id,
- null_yield);
+ y);
auto version_id = oc.o.key.instance;
r = notify->publish_reserve(oc.dpp, nullptr);
uint32_t flags = !zonegroup_lc_check(oc.dpp, oc.driver->get_zone())
? rgw::sal::FLAG_LOG_OP : 0;
int r = oc.obj->transition(oc.bucket, target_placement, o.meta.mtime,
- o.versioned_epoch, oc.dpp, null_yield, flags);
+ o.versioned_epoch, oc.dpp, y, flags);
if (r < 0) {
ldpp_dout(oc.dpp, 0) << "ERROR: failed to transition obj "
<< oc.bucket << ":" << o.key
public:
LCOpAction_CurrentTransition(const transition_action& _transition)
: LCOpAction_Transition(_transition) {}
- int process(lc_op_ctx& oc) override {
- int r = LCOpAction_Transition::process(oc);
+ int process(lc_op_ctx& oc, optional_yield y) override {
+ int r = LCOpAction_Transition::process(oc, y);
if (r == 0) {
if (perfcounter) {
perfcounter->inc(l_rgw_lc_transition_current, 1);
const transition_action& _transition)
: LCOpAction_Transition(_transition)
{}
- int process(lc_op_ctx& oc) override {
- int r = LCOpAction_Transition::process(oc);
+ int process(lc_op_ctx& oc, optional_yield y) override {
+ int r = LCOpAction_Transition::process(oc, y);
if (r == 0) {
if (perfcounter) {
perfcounter->inc(l_rgw_lc_transition_noncurrent, 1);
/* fetch information for zone checks */
rgw::sal::Zone* zone = driver->get_zone();
- auto pf = [&bucket_name](RGWLC::LCWorker* wk, WorkQ* wq, WorkItem& wi) {
+ auto pf = [&bucket_name](RGWLC::LCWorker* wk, WorkQ* wq, WorkItem& wi, optional_yield y) {
auto wt =
std::get<std::tuple<LCOpRule, rgw_bucket_dir_entry>>(wi);
auto& [op_rule, o] = wt;