summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/rgw/rgw_rados.cc17
-rw-r--r--src/rgw/rgw_sync.cc9
-rw-r--r--src/rgw/rgw_sync.h4
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