Skip to content

Commit

Permalink
Merge pull request ceph#16368 from theanalyst/fix/rgw-reshard-pool-ns
Browse files Browse the repository at this point in the history
rgw: use a namespace for rgw reshard pool for upgrades as well

Reviewed-by: Casey Bodley <[email protected]>
Reviewed-by: Orit Wasserman <[email protected]>
  • Loading branch information
yuriw authored Jul 19, 2017
2 parents 798e46b + 5c86224 commit c95ab13
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions PendingReleaseNotes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Added new configuration "public bind addr" to support dynamic environments
like Kubernetes. When set the Ceph MON daemon could bind locally to an IP
address and advertise a different IP address "public addr" on the network.
* RGW: bucket index resharding now uses the reshard namespace in upgrade scenarios as well
this is a changed behaviour from RC1 where a new pool for reshard was created

12.0.0
------
Expand Down
2 changes: 2 additions & 0 deletions src/rgw/rgw_json_enc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,7 @@ void RGWZoneParams::dump(Formatter *f) const
encode_json("log_pool", log_pool, f);
encode_json("intent_log_pool", intent_log_pool, f);
encode_json("usage_log_pool", usage_log_pool, f);
encode_json("reshard_pool", reshard_pool, f);
encode_json("user_keys_pool", user_keys_pool, f);
encode_json("user_email_pool", user_email_pool, f);
encode_json("user_swift_pool", user_swift_pool, f);
Expand Down Expand Up @@ -944,6 +945,7 @@ void RGWZoneParams::decode_json(JSONObj *obj)
JSONDecoder::decode_json("lc_pool", lc_pool, obj);
JSONDecoder::decode_json("log_pool", log_pool, obj);
JSONDecoder::decode_json("intent_log_pool", intent_log_pool, obj);
JSONDecoder::decode_json("reshard_pool", reshard_pool, obj);
JSONDecoder::decode_json("usage_log_pool", usage_log_pool, obj);
JSONDecoder::decode_json("user_keys_pool", user_keys_pool, obj);
JSONDecoder::decode_json("user_email_pool", user_email_pool, obj);
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_rados.h
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ struct RGWZoneParams : RGWSystemMetaObj {
if (struct_v >= 10) {
::decode(reshard_pool, bl);
} else {
reshard_pool = name + ".rgw.reshard";
reshard_pool = log_pool.name + ":reshard";
}
DECODE_FINISH(bl);
}
Expand Down
18 changes: 12 additions & 6 deletions src/rgw/rgw_reshard.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,14 +639,20 @@ int RGWReshard::list(int logshard_num, string& marker, uint32_t max, std::list<c
get_logshard_oid(logshard_num, &logshard_oid);

int ret = cls_rgw_reshard_list(store->reshard_pool_ctx, logshard_oid, marker, max, entries, is_truncated);
if (ret < 0 && ret != -ENOENT) {

if (ret < 0) {
if (ret == -ENOENT) {
*is_truncated = false;
ret = 0;
}
lderr(store->ctx()) << "ERROR: failed to list reshard log entries, oid=" << logshard_oid << dendl;
return ret;
}
if (ret == -ENOENT) {
*is_truncated = false;
if (ret == -EACCES) {
lderr(store->ctx()) << "access denied to pool " << store->get_zone_params().reshard_pool
<< ". Fix the pool access permissions of your client" << dendl;
}
}
return 0;

return ret;
}

int RGWReshard::get(cls_rgw_reshard_entry& entry)
Expand Down

0 comments on commit c95ab13

Please sign in to comment.