return 0;
}
+int RGWAsyncRemoveBucketInstanceInfo::_send_request(const DoutPrefixProvider *dpp)
+{
+ auto r = store->ctl()->bucket->remove_bucket_instance_info(bucket, bucket_info,
+ null_yield, dpp);
+ if (r < 0) {
+ ldpp_dout(dpp, 0) << "ERROR: failed to remove bucket instance info for "
+ << bucket_info.bucket << dendl;
+ return r;
+ }
+ return 0;
+}
+
RGWRadosBILogTrimCR::RGWRadosBILogTrimCR(
const DoutPrefixProvider *dpp,
rgw::sal::RadosStore* store,
}
};
+class RGWAsyncRemoveBucketInstanceInfo : public RGWAsyncRadosRequest {
+ rgw::sal::RadosStore* store;
+ rgw_bucket bucket;
+ RGWBucketInfo& bucket_info;
+ const DoutPrefixProvider *dpp;
+
+protected:
+ int _send_request(const DoutPrefixProvider *dpp) override;
+public:
+ RGWAsyncRemoveBucketInstanceInfo(RGWCoroutine* caller,
+ RGWAioCompletionNotifier* cn,
+ rgw::sal::RadosStore* store,
+ const rgw_bucket& bucket,
+ RGWBucketInfo& bucket_info,
+ const DoutPrefixProvider* dpp)
+ : RGWAsyncRadosRequest(caller, cn), store(store), bucket(bucket), bucket_info(bucket_info),
+ dpp(dpp) {}
+};
+
+class RGWRemoveBucketInstanceInfoCR : public RGWSimpleCoroutine {
+ RGWAsyncRadosProcessor *async_rados;
+ rgw::sal::RadosStore* store;
+ rgw_bucket bucket;
+ RGWBucketInfo& bucket_info;
+ const DoutPrefixProvider *dpp;
+
+ RGWAsyncRemoveBucketInstanceInfo* req = nullptr;
+
+public:
+ // rgw_bucket constructor
+ RGWRemoveBucketInstanceInfoCR(RGWAsyncRadosProcessor *async_rados,
+ rgw::sal::RadosStore* store,
+ const rgw_bucket& bucket,
+ RGWBucketInfo& bucket_info,
+ std::map<std::string, ceph::bufferlist>* attrs,
+ const DoutPrefixProvider *dpp)
+ : RGWSimpleCoroutine(store->ctx()), async_rados(async_rados), store(store),
+ bucket(bucket), bucket_info(bucket_info), dpp(dpp) {}
+ ~RGWRemoveBucketInstanceInfoCR() override {
+ request_cleanup();
+ }
+ void request_cleanup() override {
+ if (req) {
+ req->finish();
+ req = nullptr;
+ }
+ }
+
+ int send_request(const DoutPrefixProvider *dpp) override {
+ req = new RGWAsyncRemoveBucketInstanceInfo(this,
+ stack->create_completion_notifier(),
+ store, bucket, bucket_info, dpp);
+ async_rados->queue(req);
+ return 0;
+ }
+ int request_complete() override {
+ return req->get_ret_status();
+ }
+};
+
class RGWRadosBILogTrimCR : public RGWSimpleCoroutine {
const RGWBucketInfo& bucket_info;
int shard_id;
cct->_conf->rgw_bucket_index_max_aio)();
} else {
bucket_info.deleted = true;
+ ldpp_dout(dpp, 0) << "setting deleted to: " << bucket_info.deleted << dendl;
map<string, bufferlist> attrs;
- r = put_bucket_instance_info(bucket_info, false, real_time(), &attrs, dpp, y);
+
+ r = ctl.bucket->store_bucket_instance_info(bucket, bucket_info, y, dpp, RGWBucketCtl::BucketInstance::PutParams()
+ .set_exclusive(false)
+ .set_mtime(real_time())
+ .set_attrs(&attrs)
+ .set_orig_info(&bucket_info));
if (r < 0) {
- ldpp_dout(dpp, 0) << "WARNING: put_bucket_info on bucket=" << bucket_info.bucket.name << " returned err=" << r << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to store bucket instance info for bucket=" << bucket.name << " ret=" << r << dendl;
+ return r;
}
}
//remove bucket instance metadata
if (clean_info->first.layout.logs.front().layout.type == rgw::BucketLogType::Deleted) {
- retcode = store->ctl()->bucket->remove_bucket_instance_info(bucket, clean_info->first, null_yield, dpp);
+ yield call(new RGWRemoveBucketInstanceInfoCR(
+ store->svc()->rados->get_async_processor(),
+ store, clean_info->first.bucket,
+ clean_info->first, nullptr, dpp));
if (retcode < 0) {
ldpp_dout(dpp, 0) << "failed to remove instance bucket info: "
<< cpp_strerror(retcode) << dendl;