Skip to content

Commit

Permalink
Merge pull request ceph#58461 from cbodley/wip-cls-rgw-index-async
Browse files Browse the repository at this point in the history
cls/rgw: warn about CLSRGWConcurrentIO use in asio threads

Reviewed-by: Adam Emerson <[email protected]>
  • Loading branch information
cbodley authored Sep 26, 2024
2 parents 85315c2 + f2350a8 commit 5e8f360
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rgw/driver/rados/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "common/BackTrace.h"
#include "common/ceph_time.h"

#include "rgw_asio_thread.h"
#include "rgw_cksum.h"
#include "rgw_sal.h"
#include "rgw_zone.h"
Expand Down Expand Up @@ -5230,6 +5231,7 @@ int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& ob
}

/* remove bucket index objects asynchronously by best effort */
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
(void) CLSRGWIssueBucketIndexClean(index_pool,
bucket_objs,
cct->_conf->rgw_bucket_index_max_aio)();
Expand Down Expand Up @@ -5444,6 +5446,7 @@ int RGWRados::bucket_check_index(const DoutPrefixProvider *dpp, RGWBucketInfo& b
bucket_objs_ret.emplace(iter.first, rgw_cls_check_index_ret());
}

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
ret = CLSRGWIssueBucketCheck(index_pool, oids, bucket_objs_ret, cct->_conf->rgw_bucket_index_max_aio)();
if (ret < 0) {
return ret;
Expand All @@ -5468,6 +5471,7 @@ int RGWRados::bucket_rebuild_index(const DoutPrefixProvider *dpp, RGWBucketInfo&
return r;
}

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
return CLSRGWIssueBucketRebuild(index_pool, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
}

Expand Down Expand Up @@ -5619,6 +5623,8 @@ int RGWRados::bucket_set_reshard(const DoutPrefixProvider *dpp,
cpp_strerror(-r) << ")" << dendl;
return r;
}

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
r = CLSRGWIssueSetBucketResharding(index_pool, bucket_objs, entry, cct->_conf->rgw_bucket_index_max_aio)();
if (r < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ <<
Expand Down Expand Up @@ -9526,6 +9532,7 @@ int RGWRados::cls_obj_set_bucket_tag_timeout(const DoutPrefixProvider *dpp, RGWB
if (r < 0)
return r;

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
return CLSRGWIssueSetTagTimeout(index_pool, bucket_objs, cct->_conf->rgw_bucket_index_max_aio, timeout)();
}

Expand Down Expand Up @@ -9657,6 +9664,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp,
auto& ioctx = index_pool;
std::map<int, rgw_cls_list_ret> shard_list_results;
cls_rgw_obj_key start_after_key(start_after.name, start_after.instance);
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
r = CLSRGWIssueBucketList(ioctx, start_after_key, prefix, delimiter,
num_entries_per_shard,
list_versions, shard_oids, shard_list_results,
Expand Down Expand Up @@ -10441,6 +10449,7 @@ int RGWRados::cls_bucket_head(const DoutPrefixProvider *dpp, const RGWBucketInfo
return r;
}

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
r = CLSRGWIssueGetDirHeader(index_pool, oids, list_results, cct->_conf->rgw_bucket_index_max_aio)();
if (r < 0) {
ldpp_dout(dpp, 20) << "cls_bucket_head: CLSRGWIssueGetDirHeader() returned "
Expand Down
4 changes: 4 additions & 0 deletions src/rgw/services/svc_bi_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "svc_bilog_rados.h"
#include "svc_zone.h"

#include "rgw_asio_thread.h"
#include "rgw_bucket.h"
#include "rgw_zone.h"
#include "rgw_datalog.h"
Expand Down Expand Up @@ -339,6 +340,7 @@ int RGWSI_BucketIndex_RADOS::cls_bucket_head(const DoutPrefixProvider *dpp,
list_results.emplace(iter.first, rgw_cls_list_ret());
}

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
r = CLSRGWIssueGetDirHeader(index_pool, oids, list_results,
cct->_conf->rgw_bucket_index_max_aio)();
if (r < 0)
Expand Down Expand Up @@ -369,6 +371,7 @@ int RGWSI_BucketIndex_RADOS::init_index(const DoutPrefixProvider *dpp,
map<int, string> bucket_objs;
get_bucket_index_objects(dir_oid, idx_layout.layout.normal.num_shards, idx_layout.gen, &bucket_objs);

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
if (judge_support_logrecord) {
return CLSRGWIssueBucketIndexInit2(index_pool,
bucket_objs,
Expand Down Expand Up @@ -397,6 +400,7 @@ int RGWSI_BucketIndex_RADOS::clean_index(const DoutPrefixProvider *dpp, const RG
get_bucket_index_objects(dir_oid, idx_layout.layout.normal.num_shards,
idx_layout.gen, &bucket_objs);

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
return CLSRGWIssueBucketIndexClean(index_pool,
bucket_objs,
cct->_conf->rgw_bucket_index_max_aio)();
Expand Down
5 changes: 5 additions & 0 deletions src/rgw/services/svc_bilog_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "svc_bilog_rados.h"
#include "svc_bi_rados.h"

#include "rgw_asio_thread.h"
#include "cls/rgw/cls_rgw_client.h"

#define dout_subsys ceph_subsys_rgw
Expand Down Expand Up @@ -48,6 +49,7 @@ int RGWSI_BILog_RADOS::log_trim(const DoutPrefixProvider *dpp,
return r;
}

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
return CLSRGWIssueBILogTrim(index_pool, start_marker_mgr, end_marker_mgr, bucket_objs,
cct->_conf->rgw_bucket_index_max_aio)();
}
Expand All @@ -61,6 +63,7 @@ int RGWSI_BILog_RADOS::log_start(const DoutPrefixProvider *dpp, const RGWBucketI
if (r < 0)
return r;

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
return CLSRGWIssueResyncBucketBILog(index_pool, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
}

Expand All @@ -73,6 +76,7 @@ int RGWSI_BILog_RADOS::log_stop(const DoutPrefixProvider *dpp, const RGWBucketIn
if (r < 0)
return r;

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
return CLSRGWIssueBucketBILogStop(index_pool, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
}

Expand Down Expand Up @@ -113,6 +117,7 @@ int RGWSI_BILog_RADOS::log_list(const DoutPrefixProvider *dpp,
if (r < 0)
return r;

maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
r = CLSRGWIssueBILogList(index_pool, marker_mgr, max, oids, bi_log_lists, cct->_conf->rgw_bucket_index_max_aio)();
if (r < 0)
return r;
Expand Down

0 comments on commit 5e8f360

Please sign in to comment.