From: Casey Bodley Date: Mon, 23 Jan 2017 21:38:48 +0000 (-0500) Subject: rgw: RGWSyncLogTrimThread runs mdlog trim X-Git-Tag: v12.0.3~20^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aaab1ec2f736248b3557f42b4108e91b45f6b407;p=ceph.git rgw: RGWSyncLogTrimThread runs mdlog trim Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 5667ebd9817..facbc129a27 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3223,9 +3223,20 @@ public: return http.set_threaded(); } int process() override { - crs.run(create_data_log_trim_cr(store, &http, - cct->_conf->rgw_data_log_num_shards, - trim_interval)); + list stacks; + auto meta = new RGWCoroutinesStack(store->ctx(), &crs); + meta->call(create_meta_log_trim_cr(store, &http, + cct->_conf->rgw_md_log_max_shards, + trim_interval)); + stacks.push_back(meta); + + auto data = new RGWCoroutinesStack(store->ctx(), &crs); + data->call(create_data_log_trim_cr(store, &http, + cct->_conf->rgw_data_log_num_shards, + trim_interval)); + stacks.push_back(data); + + crs.run(stacks); return 0; } }; diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index f6c46e34dc3..f402916fcdf 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -2953,3 +2953,12 @@ class MetaPeerTrimPollCR : public MetaTrimPollCR { env(store, http, num_shards) {} }; + +RGWCoroutine* create_meta_log_trim_cr(RGWRados *store, RGWHTTPManager *http, + int num_shards, utime_t interval) +{ + if (store->is_meta_master()) { + return new MetaMasterTrimPollCR(store, http, num_shards, interval); + } + return new MetaPeerTrimPollCR(store, http, num_shards, interval); +} diff --git a/src/rgw/rgw_sync.h b/src/rgw/rgw_sync.h index 7a39bd68eea..0f1719b279f 100644 --- a/src/rgw/rgw_sync.h +++ b/src/rgw/rgw_sync.h @@ -450,4 +450,8 @@ public: int operate() override; }; +// MetaLogTrimCR factory function +RGWCoroutine* create_meta_log_trim_cr(RGWRados *store, RGWHTTPManager *http, + int num_shards, utime_t interval); + #endif