this is happening when resharding while objects are uploaded
tests steps are here:
https://gist.github.com/yuvalif/
060f66f03511bff881e952287df3087b
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ <<
": was able to take reshard lock for bucket " <<
bucket_id << dendl;
+ // the reshard may have finished, so call clear_resharding() with its current bucket info
+ ret = fetch_new_bucket_info("trying_to_clear_resharding");
+ if (ret < 0) {
+ reshard_lock.unlock();
+ ldpp_dout(dpp, 0) << __func__ <<
+ " ERROR: failed to update bucket info before clear resharding for bucket " <<
+ bucket_id << dendl;
+ continue; // try again
+ }
ret = RGWBucketReshard::clear_resharding(this->store, bucket_info, dpp);
if (ret < 0) {
reshard_lock.unlock();
ret = 0; // non-fatal error
}
- return revert_target_layout(store, bucket_info, fault, dpp);
+ if (bucket_info.layout.target_index) {
+ return revert_target_layout(store, bucket_info, fault, dpp);
+ }
+ // there is nothing to revert
+ return 0;
} // cancel_reshard
static int commit_reshard(rgw::sal::RadosStore* store,