Skip to content

Commit

Permalink
rgw: no need to RGWReshard::get before remove
Browse files Browse the repository at this point in the history
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
(cherry picked from commit 2a68224)
  • Loading branch information
oritwas authored and theanalyst committed Apr 12, 2018
1 parent fef037c commit 422514f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
9 changes: 1 addition & 8 deletions src/rgw/rgw_admin.cc
Expand Up @@ -5796,17 +5796,10 @@ int main(int argc, const char **argv)
entry.bucket_name = bucket_name;
//entry.bucket_id = bucket_id;

ret = reshard.get(entry);
ret = reshard.remove(entry);
if (ret < 0 && ret != -ENOENT) {
cerr << "Error in getting bucket " << bucket_name << ": " << cpp_strerror(-ret) << std::endl;
return ret;
} else if (ret != -ENOENT) {
ret = reshard.remove(entry);
if (ret < 0) {
cerr << "Error removing bucket " << bucket_name << " from resharding queue: " << cpp_strerror(-ret) <<
std::endl;
return ret;
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion src/rgw/rgw_reshard.cc
Expand Up @@ -677,7 +677,10 @@ int RGWReshard::get(cls_rgw_reshard_entry& entry)

int ret = cls_rgw_reshard_get(store->reshard_pool_ctx, logshard_oid, entry);
if (ret < 0) {
lderr(store->ctx()) << "ERROR: failed to get entry from reshard log, oid=" << logshard_oid << " tenant=" << entry.tenant << " bucket=" << entry.bucket_name << dendl;
if (ret != -ENOENT) {
lderr(store->ctx()) << "ERROR: failed to get entry from reshard log, oid=" << logshard_oid << " tenant=" << entry.tenant <<
" bucket=" << entry.bucket_name << dendl;
}
return ret;
}

Expand Down

0 comments on commit 422514f

Please sign in to comment.