//bucket instance cleanup in multisite setup
const auto& log = bci.info.layout.logs.back();
if (bci.info.bucket_deleted() && log.layout.type != rgw::BucketLogType::Deleted) {
- bci.info.layout.logs.push_back({0, {rgw::BucketLogType::Deleted}});
+ const auto index_log = bci.info.layout.logs.back();
+ const int shards_num = rgw::num_shards(index_log.layout.in_index);
+ bci.info.layout.logs.push_back({log.gen+1, {rgw::BucketLogType::Deleted}});
ldpp_dout(dpp, 10) << "store log layout type: " << bci.info.layout.logs.back().layout.type << dendl;
+ for (int i = 0; i < shards_num; ++i) {
+ ldpp_dout(dpp, 10) << "adding to data_log shard_id: " << i << " of gen:" << index_log.gen << dendl;
+ ret = bihandler->svc.datalog_rados->add_entry(dpp, bci.info, index_log, i,
+ null_yield);
+ if (ret < 0) {
+ ldpp_dout(dpp, 1) << "WARNING: failed writing data log for bucket="
+ << bci.info.bucket << ", shard_id=" << i << "of generation="
+ << index_log.gen << dendl;
+ } // datalog error is not fatal
+ }
}
}
const uint64_t min_generation,
std::vector<BucketTrimInstanceCR::StatusShards>::const_iterator first,
std::vector<BucketTrimInstanceCR::StatusShards>::const_iterator last,
- std::vector<std::string> *status) {
+ std::vector<std::string> *status, const DoutPrefixProvider *dpp) {
for (auto peer = first; peer != last; ++peer) {
// Peers on later generations don't get a say in the matter
if (peer->generation > min_generation) {
continue;
}
if (peer->shards.size() != status->size()) {
+ ldpp_dout(dpp, 5) << __PRETTY_FUNCTION__ << ":"
+ << "ERROR: shards don't match. peer shard:" << peer->shards.size() << " my shards:" << status->size()
+ << "for generation:" << peer->generation << dendl;
// all peers must agree on the number of shards
return -EINVAL;
}
retcode = take_min_status(cct, totrim.gen, peer_status.cbegin(),
- peer_status.cend(), &min_markers);
+ peer_status.cend(), &min_markers, dpp);
if (retcode < 0) {
ldpp_dout(dpp, 4) << "failed to correlate bucket sync status from peers" << dendl;
return set_cr_error(retcode);
inline bucket_index_layout_generation log_to_index_layout(const bucket_log_layout_generation& log_layout)
{
- ceph_assert(log_layout.layout.type == BucketLogType::InIndex);
bucket_index_layout_generation index;
index.gen = log_layout.layout.in_index.gen;
index.layout.normal = log_layout.layout.in_index.layout;