Skip to content

Commit 5e8f360

Browse files
authored
Merge pull request ceph#58461 from cbodley/wip-cls-rgw-index-async
cls/rgw: warn about CLSRGWConcurrentIO use in asio threads Reviewed-by: Adam Emerson <[email protected]>
2 parents 85315c2 + f2350a8 commit 5e8f360

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/rgw/driver/rados/rgw_rados.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "common/BackTrace.h"
2424
#include "common/ceph_time.h"
2525

26+
#include "rgw_asio_thread.h"
2627
#include "rgw_cksum.h"
2728
#include "rgw_sal.h"
2829
#include "rgw_zone.h"
@@ -5230,6 +5231,7 @@ int RGWRados::delete_bucket(RGWBucketInfo& bucket_info, RGWObjVersionTracker& ob
52305231
}
52315232

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

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

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

@@ -5619,6 +5623,8 @@ int RGWRados::bucket_set_reshard(const DoutPrefixProvider *dpp,
56195623
cpp_strerror(-r) << ")" << dendl;
56205624
return r;
56215625
}
5626+
5627+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
56225628
r = CLSRGWIssueSetBucketResharding(index_pool, bucket_objs, entry, cct->_conf->rgw_bucket_index_max_aio)();
56235629
if (r < 0) {
56245630
ldpp_dout(dpp, 0) << "ERROR: " << __func__ <<
@@ -9526,6 +9532,7 @@ int RGWRados::cls_obj_set_bucket_tag_timeout(const DoutPrefixProvider *dpp, RGWB
95269532
if (r < 0)
95279533
return r;
95289534

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

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

10452+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
1044410453
r = CLSRGWIssueGetDirHeader(index_pool, oids, list_results, cct->_conf->rgw_bucket_index_max_aio)();
1044510454
if (r < 0) {
1044610455
ldpp_dout(dpp, 20) << "cls_bucket_head: CLSRGWIssueGetDirHeader() returned "

src/rgw/services/svc_bi_rados.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "svc_bilog_rados.h"
66
#include "svc_zone.h"
77

8+
#include "rgw_asio_thread.h"
89
#include "rgw_bucket.h"
910
#include "rgw_zone.h"
1011
#include "rgw_datalog.h"
@@ -339,6 +340,7 @@ int RGWSI_BucketIndex_RADOS::cls_bucket_head(const DoutPrefixProvider *dpp,
339340
list_results.emplace(iter.first, rgw_cls_list_ret());
340341
}
341342

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

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

403+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
400404
return CLSRGWIssueBucketIndexClean(index_pool,
401405
bucket_objs,
402406
cct->_conf->rgw_bucket_index_max_aio)();

src/rgw/services/svc_bilog_rados.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "svc_bilog_rados.h"
55
#include "svc_bi_rados.h"
66

7+
#include "rgw_asio_thread.h"
78
#include "cls/rgw/cls_rgw_client.h"
89

910
#define dout_subsys ceph_subsys_rgw
@@ -48,6 +49,7 @@ int RGWSI_BILog_RADOS::log_trim(const DoutPrefixProvider *dpp,
4849
return r;
4950
}
5051

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

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

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

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

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

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

0 commit comments

Comments
 (0)