Skip to content

Commit 1976d67

Browse files
committed
rgw/lc: remove WorkQ* args
these were only used to log the WorkQ's thread name, which will no longer be relevant with coroutines Signed-off-by: Casey Bodley <[email protected]>
1 parent 2a3f117 commit 1976d67

File tree

1 file changed

+47
-71
lines changed

1 file changed

+47
-71
lines changed

src/rgw/rgw_lc.cc

Lines changed: 47 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -504,19 +504,18 @@ struct lc_op_ctx {
504504
std::unique_ptr<rgw::sal::Object> obj;
505505
RGWObjectCtx octx;
506506
const DoutPrefixProvider *dpp;
507-
WorkQ* wq;
508507

509508
std::unique_ptr<rgw::sal::PlacementTier> tier;
510509

511510
lc_op_ctx(op_env& env, rgw_bucket_dir_entry& o,
512511
boost::optional<std::string> next_key_name,
513512
uint64_t num_noncurrent,
514513
ceph::real_time effective_mtime,
515-
const DoutPrefixProvider *dpp, WorkQ* wq)
514+
const DoutPrefixProvider *dpp)
516515
: cct(env.driver->ctx()), env(env), o(o), next_key_name(next_key_name),
517516
num_noncurrent(num_noncurrent), effective_mtime(effective_mtime),
518517
driver(env.driver), bucket(env.bucket), op(env.op), ol(env.ol),
519-
octx(env.driver), dpp(dpp), wq(wq)
518+
octx(env.driver), dpp(dpp)
520519
{
521520
obj = bucket->get_object(o.key);
522521
/* once bucket versioning is enabled, the non-current entries with
@@ -759,7 +758,7 @@ class LCOpRule {
759758
void build();
760759
void update();
761760
int process(rgw_bucket_dir_entry& o, const DoutPrefixProvider *dpp,
762-
WorkQ* wq, optional_yield y);
761+
optional_yield y);
763762
}; /* LCOpRule */
764763

765764
using WorkItem =
@@ -774,7 +773,7 @@ class WorkQ : public Thread
774773
{
775774
public:
776775
using unique_lock = std::unique_lock<std::mutex>;
777-
using work_f = std::function<void(RGWLC::LCWorker*, WorkQ*, WorkItem&, optional_yield)>;
776+
using work_f = std::function<void(RGWLC::LCWorker*, WorkItem&, optional_yield)>;
778777
using dequeue_result = std::list<WorkItem>;
779778

780779
static constexpr uint32_t FLAG_NONE = 0x0000;
@@ -783,7 +782,7 @@ class WorkQ : public Thread
783782
static constexpr uint32_t FLAG_EDRAIN_SYNC = 0x0004;
784783

785784
private:
786-
const work_f bsf = [](RGWLC::LCWorker* wk, WorkQ* wq, WorkItem& wi, optional_yield) {};
785+
const work_f bsf = [](RGWLC::LCWorker* wk, WorkItem& wi, optional_yield) {};
787786
RGWLC::LCWorker* wk;
788787
uint32_t qmax;
789788
int ix;
@@ -864,7 +863,7 @@ class WorkQ : public Thread
864863
boost::asio::spawn(context, [&](boost::asio::yield_context yield) {
865864
try {
866865
optional_yield y(yield);
867-
f(wk, this, item, y);
866+
f(wk, item, y);
868867
} catch (const std::exception& e) {
869868
ldpp_dout(wk->dpp, 0) << "Coroutine error: " << e.what() << dendl;
870869
}
@@ -957,7 +956,7 @@ int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target,
957956
params.ns = RGW_OBJ_NS_MULTIPART;
958957
params.access_list_filter = MultipartMetaFilter;
959958

960-
auto pf = [&](RGWLC::LCWorker *wk, WorkQ *wq, WorkItem &wi, optional_yield y) {
959+
auto pf = [&](RGWLC::LCWorker *wk, WorkItem &wi, optional_yield y) {
961960
int ret{0};
962961
auto wt = std::get<std::tuple<lc_op, rgw_bucket_dir_entry>>(wi);
963962
auto& [rule, obj] = wt;
@@ -989,13 +988,11 @@ int RGWLC::handle_multipart_expiration(rgw::sal::Bucket* target,
989988
} else {
990989
if (ret == -ERR_NO_SUCH_UPLOAD) {
991990
ldpp_dout(wk->get_lc(), 5) << "ERROR: abort_multipart_upload "
992-
"failed, ret="
993-
<< ret << ", thread:" << wq->thr_name()
991+
"failed, ret=" << ret
994992
<< ", meta:" << obj.key << dendl;
995993
} else {
996994
ldpp_dout(wk->get_lc(), 0) << "ERROR: abort_multipart_upload "
997-
"failed, ret="
998-
<< ret << ", thread:" << wq->thr_name()
995+
"failed, ret=" << ret
999996
<< ", meta:" << obj.key << dendl;
1000997
}
1001998
} /* abort failed */
@@ -1118,7 +1115,7 @@ static int check_tags(const DoutPrefixProvider *dpp, lc_op_ctx& oc, bool *skip,
11181115
if (ret < 0) {
11191116
if (ret != -ENODATA) {
11201117
ldpp_dout(oc.dpp, 5) << "ERROR: read_obj_tags returned r="
1121-
<< ret << " " << oc.wq->thr_name() << dendl;
1118+
<< ret << dendl;
11221119
}
11231120
return 0;
11241121
}
@@ -1127,16 +1124,15 @@ static int check_tags(const DoutPrefixProvider *dpp, lc_op_ctx& oc, bool *skip,
11271124
auto iter = tags_bl.cbegin();
11281125
dest_obj_tags.decode(iter);
11291126
} catch (buffer::error& err) {
1130-
ldpp_dout(oc.dpp,0) << "ERROR: caught buffer::error, couldn't decode TagSet "
1131-
<< oc.wq->thr_name() << dendl;
1127+
ldpp_dout(oc.dpp,0) << "ERROR: caught buffer::error, couldn't decode TagSet"
1128+
<< dendl;
11321129
return -EIO;
11331130
}
11341131

11351132
if (! has_all_tags(op, dest_obj_tags)) {
11361133
ldpp_dout(oc.dpp, 20) << __func__ << "() skipping obj " << oc.obj
11371134
<< " as tags do not match in rule: "
1138-
<< op.id << " "
1139-
<< oc.wq->thr_name() << dendl;
1135+
<< op.id << dendl;
11401136
return 0;
11411137
}
11421138
}
@@ -1161,8 +1157,7 @@ class LCOpFilter_Tags : public LCOpFilter {
11611157
return false;
11621158
}
11631159
ldpp_dout(oc.dpp, 0) << "ERROR: check_tags on obj=" << oc.obj
1164-
<< " returned ret=" << ret << " "
1165-
<< oc.wq->thr_name() << dendl;
1160+
<< " returned ret=" << ret << dendl;
11661161
return false;
11671162
}
11681163

@@ -1178,20 +1173,20 @@ class LCOpAction_CurrentExpiration : public LCOpAction {
11781173
auto& o = oc.o;
11791174
if (!o.is_current()) {
11801175
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key
1181-
<< ": not current, skipping "
1182-
<< oc.wq->thr_name() << dendl;
1176+
<< ": not current, skipping"
1177+
<< dendl;
11831178
return false;
11841179
}
11851180
if (o.is_delete_marker()) {
11861181
if (oc.next_has_same_name(o.key.name)) {
11871182
ldpp_dout(dpp, 7) << __func__ << "(): dm-check SAME: key=" << o.key
1188-
<< " next_key_name: %%" << *oc.next_key_name << "%% "
1189-
<< oc.wq->thr_name() << dendl;
1183+
<< " next_key_name: %%" << *oc.next_key_name << "%%"
1184+
<< dendl;
11901185
return false;
11911186
}
11921187

11931188
ldpp_dout(dpp, 7) << __func__ << "(): dm-check DELE: key=" << o.key
1194-
<< " " << oc.wq->thr_name() << dendl;
1189+
<< dendl;
11951190

11961191
// go on to compare mtime, size, etc
11971192
}
@@ -1202,8 +1197,8 @@ class LCOpAction_CurrentExpiration : public LCOpAction {
12021197
if (op.expiration <= 0) {
12031198
if (op.expiration_date == boost::none) {
12041199
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key
1205-
<< ": no expiration set in rule, skipping "
1206-
<< oc.wq->thr_name() << dendl;
1200+
<< ": no expiration set in rule, skipping"
1201+
<< dendl;
12071202
return false;
12081203
}
12091204
is_expired = ceph_clock_now() >=
@@ -1217,8 +1212,7 @@ class LCOpAction_CurrentExpiration : public LCOpAction {
12171212

12181213
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key << ": is_expired="
12191214
<< (int)is_expired << " size_check_p: "
1220-
<< size_check_p << " "
1221-
<< oc.wq->thr_name() << dendl;
1215+
<< size_check_p << dendl;
12221216

12231217
return is_expired && size_check_p;
12241218
}
@@ -1234,13 +1228,11 @@ class LCOpAction_CurrentExpiration : public LCOpAction {
12341228
if (r < 0) {
12351229
ldpp_dout(oc.dpp, 0) << "ERROR: current is-dm remove_expired_obj "
12361230
<< oc.bucket << ":" << o.key
1237-
<< " " << cpp_strerror(r) << " "
1238-
<< oc.wq->thr_name() << dendl;
1231+
<< " " << cpp_strerror(r) << dendl;
12391232
return r;
12401233
}
12411234
ldpp_dout(oc.dpp, 2) << "DELETED: current is-dm "
1242-
<< oc.bucket << ":" << o.key
1243-
<< " " << oc.wq->thr_name() << dendl;
1235+
<< oc.bucket << ":" << o.key << dendl;
12441236
} else {
12451237
/* ! o.is_delete_marker() */
12461238
r = remove_expired_obj(oc.dpp, y, oc, !oc.bucket->versioning_enabled(),
@@ -1249,15 +1241,14 @@ class LCOpAction_CurrentExpiration : public LCOpAction {
12491241
if (r < 0) {
12501242
ldpp_dout(oc.dpp, 0) << "ERROR: remove_expired_obj "
12511243
<< oc.bucket << ":" << o.key
1252-
<< " " << cpp_strerror(r) << " "
1253-
<< oc.wq->thr_name() << dendl;
1244+
<< " " << cpp_strerror(r) << dendl;
12541245
return r;
12551246
}
12561247
if (perfcounter) {
12571248
perfcounter->inc(l_rgw_lc_expire_current, 1);
12581249
}
12591250
ldpp_dout(oc.dpp, 2) << "DELETED:" << oc.bucket << ":" << o.key
1260-
<< " " << oc.wq->thr_name() << dendl;
1251+
<< dendl;
12611252
}
12621253
return 0;
12631254
}
@@ -1273,8 +1264,7 @@ class LCOpAction_NonCurrentExpiration : public LCOpAction {
12731264
auto& o = oc.o;
12741265
if (o.is_current()) {
12751266
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key
1276-
<< ": current version, skipping "
1277-
<< oc.wq->thr_name() << dendl;
1267+
<< ": current version, skipping" << dendl;
12781268
return false;
12791269
}
12801270

@@ -1288,8 +1278,7 @@ class LCOpAction_NonCurrentExpiration : public LCOpAction {
12881278
<< is_expired << " " << ": num_noncurrent="
12891279
<< oc.num_noncurrent << " size_check_p: "
12901280
<< size_check_p << " newer_noncurrent_p: "
1291-
<< newer_noncurrent_p << " "
1292-
<< oc.wq->thr_name() << dendl;
1281+
<< newer_noncurrent_p << dendl;
12931282

12941283
return is_expired &&
12951284
(oc.num_noncurrent > oc.op.newer_noncurrent) && size_check_p &&
@@ -1304,16 +1293,14 @@ class LCOpAction_NonCurrentExpiration : public LCOpAction {
13041293
if (r < 0) {
13051294
ldpp_dout(oc.dpp, 0) << "ERROR: remove_expired_obj (non-current expiration) "
13061295
<< oc.bucket << ":" << o.key
1307-
<< " " << cpp_strerror(r)
1308-
<< " " << oc.wq->thr_name() << dendl;
1296+
<< " " << cpp_strerror(r) << dendl;
13091297
return r;
13101298
}
13111299
if (perfcounter) {
13121300
perfcounter->inc(l_rgw_lc_expire_noncurrent, 1);
13131301
}
13141302
ldpp_dout(oc.dpp, 2) << "DELETED:" << oc.bucket << ":" << o.key
1315-
<< " (non-current expiration) "
1316-
<< oc.wq->thr_name() << dendl;
1303+
<< " (non-current expiration)" << dendl;
13171304
return 0;
13181305
}
13191306
};
@@ -1326,16 +1313,15 @@ class LCOpAction_DMExpiration : public LCOpAction {
13261313
auto& o = oc.o;
13271314
if (!o.is_delete_marker()) {
13281315
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key
1329-
<< ": not a delete marker, skipping "
1330-
<< oc.wq->thr_name() << dendl;
1316+
<< ": not a delete marker, skipping" << dendl;
13311317
return false;
13321318
}
13331319
/* don't remove the delete marker if that would expose a non-current
13341320
* version as current */
13351321
if (oc.next_has_same_name(o.key.name)) {
13361322
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key
13371323
<< ": dm expiration would expose a non-current version, skipping "
1338-
<< oc.wq->thr_name() << dendl;
1324+
<< dendl;
13391325
return false;
13401326
}
13411327
*exp_time = real_clock::now();
@@ -1352,16 +1338,14 @@ class LCOpAction_DMExpiration : public LCOpAction {
13521338
ldpp_dout(oc.dpp, 0) << "ERROR: remove_expired_obj (delete marker expiration) "
13531339
<< oc.bucket << ":" << o.key
13541340
<< " " << cpp_strerror(r)
1355-
<< " " << oc.wq->thr_name()
13561341
<< dendl;
13571342
return r;
13581343
}
13591344
if (perfcounter) {
13601345
perfcounter->inc(l_rgw_lc_expire_dm, 1);
13611346
}
13621347
ldpp_dout(oc.dpp, 2) << "DELETED:" << oc.bucket << ":" << o.key
1363-
<< " (delete marker expiration) "
1364-
<< oc.wq->thr_name() << dendl;
1348+
<< " (delete marker expiration)" << dendl;
13651349
return 0;
13661350
}
13671351
};
@@ -1393,8 +1377,8 @@ class LCOpAction_Transition : public LCOpAction {
13931377
if (transition.days < 0) {
13941378
if (transition.date == boost::none) {
13951379
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key
1396-
<< ": no transition day/date set in rule, skipping "
1397-
<< oc.wq->thr_name() << dendl;
1380+
<< ": no transition day/date set in rule, skipping"
1381+
<< dendl;
13981382
return false;
13991383
}
14001384
is_expired = ceph_clock_now() >=
@@ -1408,8 +1392,7 @@ class LCOpAction_Transition : public LCOpAction {
14081392

14091393
ldpp_dout(oc.dpp, 20) << __func__ << "(): key=" << o.key << ": is_expired="
14101394
<< is_expired << " " << " size_check_p: "
1411-
<< size_check_p << " "
1412-
<< oc.wq->thr_name() << dendl;
1395+
<< size_check_p << dendl;
14131396

14141397
need_to_process =
14151398
(rgw_placement_rule::get_canonical_storage_class(o.meta.storage_class) !=
@@ -1587,8 +1570,7 @@ class LCOpAction_Transition : public LCOpAction {
15871570
ldpp_dout(oc.dpp, 0) << "ERROR: non existent dest placement: "
15881571
<< target_placement
15891572
<< " bucket="<< oc.bucket
1590-
<< " rule_id=" << oc.op.id
1591-
<< " " << oc.wq->thr_name() << dendl;
1573+
<< " rule_id=" << oc.op.id << dendl;
15921574
return -EINVAL;
15931575
}
15941576

@@ -1600,8 +1582,7 @@ class LCOpAction_Transition : public LCOpAction {
16001582
ldpp_dout(oc.dpp, 0) << "ERROR: failed to transition obj "
16011583
<< oc.bucket << ":" << o.key
16021584
<< " -> " << transition.storage_class
1603-
<< " " << cpp_strerror(r)
1604-
<< " " << oc.wq->thr_name() << dendl;
1585+
<< " " << cpp_strerror(r) << dendl;
16051586
return r;
16061587
}
16071588
}
@@ -1617,8 +1598,7 @@ class LCOpAction_Transition : public LCOpAction {
16171598

16181599
ldpp_dout(oc.dpp, 2) << "TRANSITIONED:" << oc.bucket
16191600
<< ":" << o.key << " -> "
1620-
<< transition.storage_class
1621-
<< " " << oc.wq->thr_name() << dendl;
1601+
<< transition.storage_class << dendl;
16221602
return 0;
16231603
}
16241604
};
@@ -1708,9 +1688,9 @@ void LCOpRule::update()
17081688

17091689
int LCOpRule::process(rgw_bucket_dir_entry& o,
17101690
const DoutPrefixProvider *dpp,
1711-
WorkQ* wq, optional_yield y)
1691+
optional_yield y)
17121692
{
1713-
lc_op_ctx ctx(env, o, next_key_name, num_noncurrent, effective_mtime, dpp, wq);
1693+
lc_op_ctx ctx(env, o, next_key_name, num_noncurrent, effective_mtime, dpp);
17141694
shared_ptr<LCOpAction> *selected = nullptr; // n.b., req'd by sharing
17151695
real_time exp;
17161696

@@ -1747,21 +1727,19 @@ int LCOpRule::process(rgw_bucket_dir_entry& o,
17471727

17481728
if (!cont) {
17491729
ldpp_dout(dpp, 20) << __func__ << "(): key=" << o.key
1750-
<< ": no rule match, skipping "
1751-
<< wq->thr_name() << dendl;
1730+
<< ": no rule match, skipping" << dendl;
17521731
return 0;
17531732
}
17541733

17551734
int r = (*selected)->process(ctx, y);
17561735
if (r < 0) {
17571736
ldpp_dout(dpp, 0) << "ERROR: remove_expired_obj "
17581737
<< env.bucket << ":" << o.key
1759-
<< " " << cpp_strerror(r)
1760-
<< " " << wq->thr_name() << dendl;
1738+
<< " " << cpp_strerror(r) << dendl;
17611739
return r;
17621740
}
17631741
ldpp_dout(dpp, 20) << "processed:" << env.bucket << ":"
1764-
<< o.key << " " << wq->thr_name() << dendl;
1742+
<< o.key << dendl;
17651743
}
17661744

17671745
return 0;
@@ -1830,19 +1808,17 @@ int RGWLC::bucket_lc_process(string& shard_id, LCWorker* worker,
18301808
/* fetch information for zone checks */
18311809
rgw::sal::Zone* zone = driver->get_zone();
18321810

1833-
auto pf = [&bucket_name](RGWLC::LCWorker* wk, WorkQ* wq, WorkItem& wi, optional_yield y) {
1811+
auto pf = [&bucket_name](RGWLC::LCWorker* wk, WorkItem& wi, optional_yield y) {
18341812
auto wt =
18351813
std::get<std::tuple<LCOpRule, rgw_bucket_dir_entry>>(wi);
18361814
auto& [op_rule, o] = wt;
18371815

18381816
ldpp_dout(wk->get_lc(), 20)
1839-
<< __func__ << "(): key=" << o.key << wq->thr_name()
1840-
<< dendl;
1841-
int ret = op_rule.process(o, wk->dpp, wq, y);
1817+
<< __func__ << "(): key=" << o.key << dendl;
1818+
int ret = op_rule.process(o, wk->dpp, y);
18421819
if (ret < 0) {
18431820
ldpp_dout(wk->get_lc(), 20)
18441821
<< "ERROR: orule.process() returned ret=" << ret
1845-
<< " thread=" << wq->thr_name()
18461822
<< " bucket=" << bucket_name
18471823
<< dendl;
18481824
}

0 commit comments

Comments
 (0)