Skip to content

Commit 19fed6b

Browse files
authored
Merge pull request ceph#59001 from cbodley/wip-rgw-async-inline-gc
rgw/rados: delete_objs_inline() uses rgw_rados_operate() Reviewed-by: Daniel Gryniewicz <[email protected]>
2 parents 6edfcab + 4424f55 commit 19fed6b

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5332,12 +5332,12 @@ int RGWRados::Object::complete_atomic_modification(const DoutPrefixProvider *dpp
53325332
if (store->gc == nullptr) {
53335333
ldpp_dout(dpp, 0) << "deleting objects inline since gc isn't initialized" << dendl;
53345334
//Delete objects inline just in case gc hasn't been initialised, prevents crashes
5335-
store->delete_objs_inline(dpp, chain, tag);
5335+
store->delete_objs_inline(dpp, chain, tag, y);
53365336
} else {
53375337
auto [ret, leftover_chain] = store->gc->send_split_chain(chain, tag, y); // do it synchronously
53385338
if (ret < 0 && leftover_chain) {
53395339
//Delete objects inline if send chain to gc fails
5340-
store->delete_objs_inline(dpp, *leftover_chain, tag);
5340+
store->delete_objs_inline(dpp, *leftover_chain, tag, y);
53415341
}
53425342
}
53435343
return 0;
@@ -5366,7 +5366,8 @@ std::tuple<int, std::optional<cls_rgw_obj_chain>> RGWRados::send_chain_to_gc(cls
53665366
return gc->send_split_chain(chain, tag, y);
53675367
}
53685368

5369-
void RGWRados::delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain, const string& tag)
5369+
void RGWRados::delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain,
5370+
const string& tag, optional_yield y)
53705371
{
53715372
string last_pool;
53725373
std::unique_ptr<IoCtx> ctx(new IoCtx);
@@ -5390,7 +5391,7 @@ void RGWRados::delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_cha
53905391
":" << obj.key.name << dendl;
53915392
ObjectWriteOperation op;
53925393
cls_refcount_put(op, tag, true);
5393-
ret = ctx->operate(oid, &op);
5394+
ret = rgw_rados_operate(dpp, *ctx, oid, &op, y);
53945395
if (ret < 0) {
53955396
ldpp_dout(dpp, 5) << "delete_objs_inline: refcount put returned error " << ret << dendl;
53965397
}
@@ -7221,7 +7222,7 @@ int RGWRados::Object::Read::read(int64_t ofs, int64_t end,
72217222

72227223
state.cur_ioctx->locator_set_key(read_obj.loc);
72237224

7224-
r = state.cur_ioctx->operate(read_obj.oid, &op, NULL);
7225+
r = rgw_rados_operate(dpp, *state.cur_ioctx, read_obj.oid, &op, nullptr, y);
72257226
ldpp_dout(dpp, 20) << "rados->read r=" << r << " bl.length=" << bl.length() << dendl;
72267227

72277228
if (r < 0) {

src/rgw/driver/rados/rgw_rados.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,8 @@ class RGWRados
15471547

15481548
void update_gc_chain(const DoutPrefixProvider *dpp, rgw_obj head_obj, RGWObjManifest& manifest, cls_rgw_obj_chain *chain);
15491549
std::tuple<int, std::optional<cls_rgw_obj_chain>> send_chain_to_gc(cls_rgw_obj_chain& chain, const std::string& tag, optional_yield y);
1550-
void delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain, const std::string& tag);
1550+
void delete_objs_inline(const DoutPrefixProvider *dpp, cls_rgw_obj_chain& chain,
1551+
const std::string& tag, optional_yield y);
15511552
int gc_operate(const DoutPrefixProvider *dpp, std::string& oid, librados::ObjectWriteOperation *op, optional_yield y);
15521553
int gc_aio_operate(const std::string& oid, librados::AioCompletion *c,
15531554
librados::ObjectWriteOperation *op);

src/rgw/driver/rados/rgw_sal_rados.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2989,7 +2989,7 @@ int RadosMultipartUpload::cleanup_part_history(const DoutPrefixProvider* dpp,
29892989
}
29902990
if (store->getRados()->get_gc() == nullptr) {
29912991
// Delete objects inline if gc hasn't been initialised (in case when bypass gc is specified)
2992-
store->getRados()->delete_objs_inline(dpp, chain, mp_obj.get_upload_id());
2992+
store->getRados()->delete_objs_inline(dpp, chain, mp_obj.get_upload_id(), y);
29932993
} else {
29942994
// use upload id as tag and do it synchronously
29952995
auto [ret, leftover_chain] = store->getRados()->send_chain_to_gc(chain, mp_obj.get_upload_id(), y);
@@ -2999,7 +2999,7 @@ int RadosMultipartUpload::cleanup_part_history(const DoutPrefixProvider* dpp,
29992999
return -ERR_NO_SUCH_UPLOAD;
30003000
}
30013001
// Delete objects inline if send chain to gc fails
3002-
store->getRados()->delete_objs_inline(dpp, *leftover_chain, mp_obj.get_upload_id());
3002+
store->getRados()->delete_objs_inline(dpp, *leftover_chain, mp_obj.get_upload_id(), y);
30033003
}
30043004
}
30053005
return 0;
@@ -3059,7 +3059,7 @@ int RadosMultipartUpload::abort(const DoutPrefixProvider *dpp, CephContext *cct,
30593059

30603060
if (store->getRados()->get_gc() == nullptr) {
30613061
//Delete objects inline if gc hasn't been initialised (in case when bypass gc is specified)
3062-
store->getRados()->delete_objs_inline(dpp, chain, mp_obj.get_upload_id());
3062+
store->getRados()->delete_objs_inline(dpp, chain, mp_obj.get_upload_id(), y);
30633063
} else {
30643064
/* use upload id as tag and do it synchronously */
30653065
auto [ret, leftover_chain] = store->getRados()->send_chain_to_gc(chain, mp_obj.get_upload_id(), y);
@@ -3069,7 +3069,7 @@ int RadosMultipartUpload::abort(const DoutPrefixProvider *dpp, CephContext *cct,
30693069
return -ERR_NO_SUCH_UPLOAD;
30703070
}
30713071
//Delete objects inline if send chain to gc fails
3072-
store->getRados()->delete_objs_inline(dpp, *leftover_chain, mp_obj.get_upload_id());
3072+
store->getRados()->delete_objs_inline(dpp, *leftover_chain, mp_obj.get_upload_id(), y);
30733073
}
30743074
}
30753075

0 commit comments

Comments
 (0)