#include "common/errno.h"
#include "rgw_common.h"
-#include "rgw_rados.h"
#include "rgw_zone.h"
#include "rgw_sync.h"
#include "rgw_metadata.h"
rgw_http_param_pair pairs[] = { { "type", "metadata" },
{ NULL, NULL } };
- int ret = conn->get_json_resource("/admin/log", pairs, *log_info);
+ int ret = conn->get_json_resource("/admin/log", pairs, null_yield, *log_info);
if (ret < 0) {
ldpp_dout(dpp, 0) << "ERROR: failed to fetch mdlog info" << dendl;
return ret;
RGWRESTConn *conn = sync_env->conn;
reenter(this) {
yield {
+ string key_encode;
+ url_encode(key, key_encode);
rgw_http_param_pair pairs[] = { { "key" , key.c_str()},
{ NULL, NULL } };
- string p = string("/admin/metadata/") + section + "/" + key;
+ string p = string("/admin/metadata/") + section + "/" + key_encode;
http_op = new RGWRESTReadResource(conn, p, pairs, NULL, sync_env->http_manager);
bufferlist bl;
protected:
int _send_request() override {
- int ret = store->ctl()->meta.mgr->put(raw_key, bl, null_yield, RGWMDLogSyncType::APPLY_ALWAYS);
+ int ret = store->ctl()->meta.mgr->put(raw_key, bl, null_yield, RGWMDLogSyncType::APPLY_ALWAYS, true);
if (ret < 0) {
ldout(store->ctx(), 0) << "ERROR: can't store key: " << raw_key << " ret=" << ret << dendl;
return ret;
// return a cursor to the period at our sync position
static RGWPeriodHistory::Cursor get_period_at(rgw::sal::RGWRadosStore* store,
- const rgw_meta_sync_info& info)
+ const rgw_meta_sync_info& info,
+ optional_yield y)
{
if (info.period.empty()) {
// return an empty cursor with error=0
// read the period from rados or pull it from the master
RGWPeriod period;
- int r = store->svc()->mdlog->pull_period(info.period, period);
+ int r = store->svc()->mdlog->pull_period(info.period, period, y);
if (r < 0) {
lderr(store->ctx()) << "ERROR: failed to read period id "
<< info.period << ": " << cpp_strerror(r) << dendl;
return RGWPeriodHistory::Cursor{r};
}
// attach the period to our history
- cursor = store->svc()->mdlog->get_period_history()->attach(std::move(period));
+ cursor = store->svc()->mdlog->get_period_history()->attach(std::move(period), y);
if (!cursor) {
r = cursor.get_error();
lderr(store->ctx()) << "ERROR: failed to read period history back to "
return cursor;
}
-int RGWRemoteMetaLog::run_sync()
+int RGWRemoteMetaLog::run_sync(optional_yield y)
{
if (store->svc()->zone->is_meta_master()) {
return 0;
case rgw_meta_sync_info::StateSync:
tn->log(20, "sync");
// find our position in the period history (if any)
- cursor = get_period_at(store, sync_status.sync_info);
+ cursor = get_period_at(store, sync_status.sync_info, y);
r = cursor.get_error();
if (r < 0) {
return r;