diff options
author | Casey Bodley <cbodley@redhat.com> | 2017-01-23 22:38:48 +0100 |
---|---|---|
committer | Casey Bodley <cbodley@redhat.com> | 2017-04-27 16:39:22 +0200 |
commit | aaab1ec2f736248b3557f42b4108e91b45f6b407 (patch) | |
tree | f797a753403cade46c4de8d0453b2bcb19526e83 | |
parent | rgw: add MetaTrimPollCR to coordinate polling and leases (diff) | |
download | ceph-aaab1ec2f736248b3557f42b4108e91b45f6b407.tar.xz ceph-aaab1ec2f736248b3557f42b4108e91b45f6b407.zip |
rgw: RGWSyncLogTrimThread runs mdlog trim
Signed-off-by: Casey Bodley <cbodley@redhat.com>
-rw-r--r-- | src/rgw/rgw_rados.cc | 17 | ||||
-rw-r--r-- | src/rgw/rgw_sync.cc | 9 | ||||
-rw-r--r-- | src/rgw/rgw_sync.h | 4 |
3 files changed, 27 insertions, 3 deletions
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<RGWCoroutinesStack*> 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 |