bucket->get_info().flags |= BUCKET_DATASYNC_DISABLED;
}
+ // when writing this metadata, RGWSI_BucketIndex_RADOS::handle_overwrite()
+ // will write the corresponding datalog and bilog entries
int r = bucket->put_info(dpp, false, real_time());
if (r < 0) {
set_err_msg(err_msg, "ERROR: failed writing bucket instance info:" + cpp_strerror(-r));
return r;
}
- int shards_num = bucket->get_info().layout.current_index.layout.normal.num_shards? bucket->get_info().layout.current_index.layout.normal.num_shards : 1;
- int shard_id = bucket->get_info().layout.current_index.layout.normal.num_shards? 0 : -1;
- const auto& log_layout = bucket->get_info().layout.logs.back();
-
- if (!sync) {
- r = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_stop(dpp, bucket->get_info(), log_layout, -1);
- if (r < 0) {
- set_err_msg(err_msg, "ERROR: failed writing stop bilog:" + cpp_strerror(-r));
- return r;
- }
- } else {
- r = static_cast<rgw::sal::RadosStore*>(store)->svc()->bilog_rados->log_start(dpp, bucket->get_info(), log_layout, -1);
- if (r < 0) {
- set_err_msg(err_msg, "ERROR: failed writing resync bilog:" + cpp_strerror(-r));
- return r;
- }
- }
-
- for (int i = 0; i < shards_num; ++i, ++shard_id) {
- r = static_cast<rgw::sal::RadosStore*>(store)
- ->svc()->datalog_rados->add_entry(dpp, bucket->get_info(),
- bucket->get_info().layout.logs.back(),
- shard_id);
- if (r < 0) {
- set_err_msg(err_msg, "ERROR: failed writing data log:" + cpp_strerror(-r));
- return r;
- }
- }
-
return 0;
}