Skip to content

Commit f2350a8

Browse files
committed
cls/rgw: warn about CLSRGWConcurrentIO use in asio threads
bucket index operations that need to visit every index shard object use this CLSRGWConcurrentIO class to issue several requests in parallel, then wait on a condition variable for completions. this wait causes asio threads to block, so add warnings to all call sites Signed-off-by: Casey Bodley <[email protected]>
1 parent 4ee8e59 commit f2350a8

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)();
@@ -5436,6 +5438,7 @@ int RGWRados::bucket_check_index(const DoutPrefixProvider *dpp, RGWBucketInfo& b
54365438
bucket_objs_ret.emplace(iter.first, rgw_cls_check_index_ret());
54375439
}
54385440

5441+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
54395442
ret = CLSRGWIssueBucketCheck(index_pool, oids, bucket_objs_ret, cct->_conf->rgw_bucket_index_max_aio)();
54405443
if (ret < 0) {
54415444
return ret;
@@ -5460,6 +5463,7 @@ int RGWRados::bucket_rebuild_index(const DoutPrefixProvider *dpp, RGWBucketInfo&
54605463
return r;
54615464
}
54625465

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

@@ -5611,6 +5615,8 @@ int RGWRados::bucket_set_reshard(const DoutPrefixProvider *dpp,
56115615
cpp_strerror(-r) << ")" << dendl;
56125616
return r;
56135617
}
5618+
5619+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
56145620
r = CLSRGWIssueSetBucketResharding(index_pool, bucket_objs, entry, cct->_conf->rgw_bucket_index_max_aio)();
56155621
if (r < 0) {
56165622
ldpp_dout(dpp, 0) << "ERROR: " << __func__ <<
@@ -9527,6 +9533,7 @@ int RGWRados::cls_obj_set_bucket_tag_timeout(const DoutPrefixProvider *dpp, RGWB
95279533
if (r < 0)
95289534
return r;
95299535

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

@@ -9658,6 +9665,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp,
96589665
auto& ioctx = index_pool;
96599666
std::map<int, rgw_cls_list_ret> shard_list_results;
96609667
cls_rgw_obj_key start_after_key(start_after.name, start_after.instance);
9668+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
96619669
r = CLSRGWIssueBucketList(ioctx, start_after_key, prefix, delimiter,
96629670
num_entries_per_shard,
96639671
list_versions, shard_oids, shard_list_results,
@@ -10438,6 +10446,7 @@ int RGWRados::cls_bucket_head(const DoutPrefixProvider *dpp, const RGWBucketInfo
1043810446
return r;
1043910447
}
1044010448

10449+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
1044110450
r = CLSRGWIssueGetDirHeader(index_pool, oids, list_results, cct->_conf->rgw_bucket_index_max_aio)();
1044210451
if (r < 0) {
1044310452
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,
@@ -396,6 +399,7 @@ int RGWSI_BucketIndex_RADOS::clean_index(const DoutPrefixProvider *dpp, RGWBucke
396399
get_bucket_index_objects(dir_oid, idx_layout.layout.normal.num_shards,
397400
idx_layout.gen, &bucket_objs);
398401

402+
maybe_warn_about_blocking(dpp); // TODO: use AioTrottle
399403
return CLSRGWIssueBucketIndexClean(index_pool,
400404
bucket_objs,
401405
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)