Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NES-55] complement PR (#54) #55

Merged
merged 5 commits into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 13 additions & 15 deletions src/rgw/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6080,6 +6080,7 @@ int RGWRados::Bucket::UpdateIndex::complete(int64_t poolid, uint64_t epoch,
return 0;
}
RGWRados *store = target->get_store();
BucketShard *bs;

rgw_bucket_dir_entry ent;
obj.key.get_index_key(&ent.key);
Expand All @@ -6105,16 +6106,15 @@ int RGWRados::Bucket::UpdateIndex::complete(int64_t poolid, uint64_t epoch,

// Follows up the bucket shards that may have changed during the data write.
// Wait for resharding that may be in progress.
int ret = guard_reshard(nullptr, [&](BucketShard *bs) -> int {
int comp_add_ret = store->cls_obj_complete_add(*bs, obj, optag, poolid, epoch, ent, category, remove_objs, bilog_flags, zones_trace);

int log_add_ret = store->svc.datalog_rados->add_entry(target->bucket_info, bs->shard_id);
if (log_add_ret < 0) {
lderr(store->ctx()) << "ERROR: failed writing data log" << dendl;
}
return comp_add_ret;
int ret = guard_reshard(&bs, [&](BucketShard *bs) -> int {
return store->cls_obj_complete_add(*bs, obj, optag, poolid, epoch, ent, category, remove_objs, bilog_flags, zones_trace);
});

int r = store->svc.datalog_rados->add_entry(target->bucket_info, bs->shard_id);
if (r < 0) {
lderr(store->ctx()) << "ERROR: failed writing data log" << dendl;
}

return ret;
}

Expand All @@ -6128,13 +6128,11 @@ int RGWRados::Bucket::UpdateIndex::complete_del(int64_t poolid, uint64_t epoch,
RGWRados *store = target->get_store();
BucketShard *bs;

int ret = get_bucket_shard(&bs);
if (ret < 0) {
ldout(store->ctx(), 5) << "failed to get BucketShard object: ret=" << ret << dendl;
return ret;
}

ret = store->cls_obj_complete_del(*bs, optag, poolid, epoch, obj, removed_mtime, remove_objs, bilog_flags, zones_trace);
// Follows up the bucket shards that may have changed during the data deletion.
// Wait for resharding that may be in progress.
int ret = guard_reshard(&bs, [&](BucketShard *bs) -> int {
return store->cls_obj_complete_del(*bs, optag, poolid, epoch, obj, removed_mtime, remove_objs, bilog_flags, zones_trace);
});

int r = store->svc.datalog_rados->add_entry(target->bucket_info, bs->shard_id);
if (r < 0) {
Expand Down