return 0;
}
-int RGWRados::trim_reshard_log_entries(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, optional_yield y)
-{
- librados::IoCtx index_pool;
- map<int, string> bucket_objs;
-
- int r = svc.bi_rados->open_bucket_index(dpp, bucket_info, std::nullopt, bucket_info.layout.current_index, &index_pool, &bucket_objs, nullptr);
- if (r < 0) {
- return r;
- }
- return CLSRGWIssueReshardLogTrim(index_pool, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
-}
-
int RGWRados::gc_operate(const DoutPrefixProvider *dpp, string& oid, librados::ObjectWriteOperation&& op, optional_yield y)
{
return rgw_rados_operate(dpp, gc_pool_ctx, oid, std::move(op), y);
std::list<rgw_cls_bi_entry> *entries, bool *is_truncated, bool reshardlog, optional_yield y);
int bi_remove(const DoutPrefixProvider *dpp, BucketShard& bs);
- int trim_reshard_log_entries(const DoutPrefixProvider *dpp, RGWBucketInfo& bucket_info, optional_yield y);
int cls_obj_usage_log_add(const DoutPrefixProvider *dpp, const std::string& oid, rgw_usage_log_info& info, optional_yield y);
int cls_obj_usage_log_read(const DoutPrefixProvider *dpp, const std::string& oid, const std::string& user, const std::string& bucket, uint64_t start_epoch,
ret = 0; // non-fatal error
}
// trim the reshard log entries written in logrecord state
- ret = store->getRados()->trim_reshard_log_entries(dpp, bucket_info, y);
+ ret = store->svc()->bi_rados->trim_reshard_log(dpp, y, bucket_info);
if (ret < 0) {
ldpp_dout(dpp, 1) << "WARNING: " << __func__ << " failed to trim "
"reshard log entries: " << cpp_strerror(ret) << dendl;
if (support_logrecord) {
if (ret = fault.check("trim_reshard_log_entries");
ret == 0) { // no fault injected, trim reshard log entries
- ret = store->getRados()->trim_reshard_log_entries(dpp, bucket_info, y);
+ ret = store->svc()->bi_rados->trim_reshard_log(dpp, y, bucket_info);
}
if (ret == -EOPNOTSUPP) {
// not an error, logrecord is not supported, change to block reshard
- ldpp_dout(dpp, 0) << "WARNING: " << "trim_reshard_log_entries() does not supported"
+ ldpp_dout(dpp, 0) << "WARNING: " << "trim_reshard_log() does not supported"
<< " logrecord, falling back to block reshard mode." << dendl;
bucket_info.layout.resharding = rgw::BucketReshardState::InProgress;
support_logrecord = false;
cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
return -ret;
}
- ret = static_cast<rgw::sal::RadosStore*>(driver)->getRados()->trim_reshard_log_entries(dpp(), bucket->get_info(), null_yield);
+ ret = static_cast<rgw::sal::RadosStore*>(driver)->svc()->bi_rados->trim_reshard_log(dpp(), null_yield, bucket->get_info());
if (ret < 0) {
- cerr << "ERROR: trim_reshard_log_entries(): " << cpp_strerror(-ret) << std::endl;
+ cerr << "ERROR: trim_reshard_log(): " << cpp_strerror(-ret) << std::endl;
return -ret;
}
}
return r;
}
+int RGWSI_BucketIndex_RADOS::trim_reshard_log(const DoutPrefixProvider* dpp,
+ optional_yield y,
+ const RGWBucketInfo& bucket_info)
+{
+ librados::IoCtx index_pool;
+ map<int, string> bucket_objs;
+
+ int r = open_bucket_index(dpp, bucket_info, std::nullopt, bucket_info.layout.current_index, &index_pool, &bucket_objs, nullptr);
+ if (r < 0) {
+ return r;
+ }
+ return CLSRGWIssueReshardLogTrim(index_pool, bucket_objs, cct->_conf->rgw_bucket_index_max_aio)();
+}
+
int RGWSI_BucketIndex_RADOS::handle_overwrite(const DoutPrefixProvider *dpp,
const RGWBucketInfo& info,
const RGWBucketInfo& orig_info,
int set_reshard_status(const DoutPrefixProvider *dpp,
const RGWBucketInfo& bucket_info,
cls_rgw_reshard_status status);
+ int trim_reshard_log(const DoutPrefixProvider* dpp, optional_yield,
+ const RGWBucketInfo& bucket_info);
int handle_overwrite(const DoutPrefixProvider *dpp, const RGWBucketInfo& info,
const RGWBucketInfo& orig_info,