common_init_finish(g_ceph_context);
- rgw_tools_init(g_ceph_context);
+ rgw_tools_init(this, g_ceph_context);
rgw_init_resolver();
rgw::curl::setup_curl(boost::none);
return 0;
}
-uint32_t RGWAccessControlList::get_referer_perm(const uint32_t current_perm,
+uint32_t RGWAccessControlList::get_referer_perm(const DoutPrefixProvider *dpp,
+ const uint32_t current_perm,
const std::string http_referer,
const uint32_t perm_mask)
{
- ldout(cct, 5) << "Searching permissions for referer=" << http_referer
+ ldpp_dout(dpp, 5) << "Searching permissions for referer=" << http_referer
<< " mask=" << perm_mask << dendl;
/* This function is basically a transformation from current perm to
}
}
- ldout(cct, 5) << "Found referer permission=" << referer_perm << dendl;
+ ldpp_dout(dpp, 5) << "Found referer permission=" << referer_perm << dendl;
return referer_perm & perm_mask;
}
/* Should we continue looking up even deeper? */
if (nullptr != http_referer && (perm & perm_mask) != perm_mask) {
- perm = acl.get_referer_perm(perm, http_referer, perm_mask);
+ perm = acl.get_referer_perm(dpp, perm, http_referer, perm_mask);
}
ldpp_dout(dpp, 5) << "-- Getting permissions done for identity=" << auth_identity
const rgw::auth::Identity& auth_identity,
uint32_t perm_mask);
uint32_t get_group_perm(const DoutPrefixProvider *dpp, ACLGroupTypeEnum group, uint32_t perm_mask) const;
- uint32_t get_referer_perm(uint32_t current_perm,
+ uint32_t get_referer_perm(const DoutPrefixProvider *dpp, uint32_t current_perm,
std::string http_referer,
uint32_t perm_mask);
void encode(bufferlist& bl) const {
user = store->get_user(rgw_user(uid));
if (user->load_user(dpp, null_yield) < 0) {
- ldout(cct, 10) << "grant user does not exist: " << uid << dendl;
+ ldpp_dout(dpp, 10) << "grant user does not exist: " << uid << dendl;
/* skipping silently */
grant.set_canon(user->get_id(), std::string(), perm);
} else {
r = add_grants(dpp, store, uids, SWIFT_PERM_READ);
if (r < 0) {
- ldout(cct, 0) << "ERROR: add_grants for read returned r="
+ ldpp_dout(dpp, 0) << "ERROR: add_grants for read returned r="
<< r << dendl;
return r;
}
r = add_grants(dpp, store, uids, SWIFT_PERM_WRITE);
if (r < 0) {
- ldout(cct, 0) << "ERROR: add_grants for write returned r="
+ ldpp_dout(dpp, 0) << "ERROR: add_grants for write returned r="
<< r << dendl;
return r;
}
std::unique_ptr<rgw::sal::User> user = store->get_user(rgw_user(uid));
if (user->load_user(dpp, null_yield) < 0) {
- ldout(cct, 10) << "grant user does not exist:" << uid << dendl;
+ ldpp_dout(dpp, 10) << "grant user does not exist:" << uid << dendl;
/* skipping silently */
grant.set_canon(user->get_id(), std::string(), perm);
acl.add_grant(&grant);
if (!iter.end() && (*iter)->is_array()) {
std::vector<std::string> admin;
decode_json_obj(admin, *iter);
- ldout(cct, 0) << "admins: " << admin << dendl;
+ ldpp_dout(dpp, 0) << "admins: " << admin << dendl;
add_grants(dpp, store, admin, SWIFT_PERM_ADMIN);
}
if (!iter.end() && (*iter)->is_array()) {
std::vector<std::string> readwrite;
decode_json_obj(readwrite, *iter);
- ldout(cct, 0) << "read-write: " << readwrite << dendl;
+ ldpp_dout(dpp, 0) << "read-write: " << readwrite << dendl;
add_grants(dpp, store, readwrite, SWIFT_PERM_RWRT);
}
if (!iter.end() && (*iter)->is_array()) {
std::vector<std::string> readonly;
decode_json_obj(readonly, *iter);
- ldout(cct, 0) << "read-only: " << readonly << dendl;
+ ldpp_dout(dpp, 0) << "read-only: " << readonly << dendl;
add_grants(dpp, store, readonly, SWIFT_PERM_READ);
}
set<rgw_zone_id> source_zones;
set<rgw_zone_id> target_zones;
- zone_policy_handler->reflect(nullptr, nullptr,
+ zone_policy_handler->reflect(dpp(), nullptr, nullptr,
nullptr, nullptr,
&source_zones,
&target_zones,
string marker;
do {
entries.clear();
- ret = reshard.list(i, marker, max_entries - count, entries, &is_truncated);
+ ret = reshard.list(dpp(), i, marker, max_entries - count, entries, &is_truncated);
if (ret < 0) {
cerr << "Error listing resharding buckets: " << cpp_strerror(-ret) << std::endl;
return ret;
// with these
{
RGWBucketReshardLock reshard_lock(static_cast<rgw::sal::RadosStore*>(store), cur_bucket->get_info(), true);
- r = reshard_lock.lock();
+ r = reshard_lock.lock(dpp);
if (r < 0) {
// most likely bucket is under reshard, return the sureshot stale instances
ldpp_dout(dpp, 5) << __func__
template <typename CB>
-void rgw_sync_group_pipe_map::init(CephContext *cct,
+void rgw_sync_group_pipe_map::init(const DoutPrefixProvider *dpp,
+ CephContext *cct,
const rgw_zone_id& _zone,
std::optional<rgw_bucket> _bucket,
const rgw_sync_policy_group& group,
/* only look at pipes that touch the specific zone and bucket */
for (auto& pipe : group.pipes) {
if (pipe.contains_zone_bucket(zone, bucket)) {
- ldout(cct, 20) << __func__ << "(): pipe_map (zone=" << zone << " bucket=" << bucket_key << "): adding potential pipe: " << pipe << dendl;
+ ldpp_dout(dpp, 20) << __func__ << "(): pipe_map (zone=" << zone << " bucket=" << bucket_key << "): adding potential pipe: " << pipe << dendl;
zone_pipes.push_back(pipe);
}
}
return found;
}
-void RGWBucketSyncFlowManager::init(const rgw_sync_policy_info& sync_policy) {
+void RGWBucketSyncFlowManager::init(const DoutPrefixProvider *dpp, const rgw_sync_policy_info& sync_policy) {
std::optional<rgw_sync_data_flow_group> default_flow;
if (parent) {
default_flow.emplace();
auto& group = item.second;
auto& flow_group_map = flow_groups[group.id];
- flow_group_map.init(cct, zone_id, bucket, group,
+ flow_group_map.init(dpp, cct, zone_id, bucket, group,
(default_flow ? &(*default_flow) : nullptr),
&all_zones,
[&](const rgw_zone_id& source_zone,
}
}
-void RGWBucketSyncFlowManager::reflect(std::optional<rgw_bucket> effective_bucket,
+void RGWBucketSyncFlowManager::reflect(const DoutPrefixProvider *dpp,
+ std::optional<rgw_bucket> effective_bucket,
RGWBucketSyncFlowManager::pipe_set *source_pipes,
RGWBucketSyncFlowManager::pipe_set *dest_pipes,
bool only_enabled) const
effective_bucket_key = effective_bucket->get_key();
}
if (parent) {
- parent->reflect(effective_bucket, source_pipes, dest_pipes, only_enabled);
+ parent->reflect(dpp, effective_bucket, source_pipes, dest_pipes, only_enabled);
}
for (auto& item : flow_groups) {
pipe.source.apply_bucket(effective_bucket);
pipe.dest.apply_bucket(effective_bucket);
- ldout(cct, 20) << __func__ << "(): flow manager (bucket=" << effective_bucket_key << "): adding source pipe: " << pipe << dendl;
+ ldpp_dout(dpp, 20) << __func__ << "(): flow manager (bucket=" << effective_bucket_key << "): adding source pipe: " << pipe << dendl;
source_pipes->insert(pipe);
}
pipe.source.apply_bucket(effective_bucket);
pipe.dest.apply_bucket(effective_bucket);
- ldout(cct, 20) << __func__ << "(): flow manager (bucket=" << effective_bucket_key << "): adding dest pipe: " << pipe << dendl;
+ ldpp_dout(dpp, 20) << __func__ << "(): flow manager (bucket=" << effective_bucket_key << "): adding dest pipe: " << pipe << dendl;
dest_pipes->insert(pipe);
}
}
return r;
}
- flow_mgr->init(sync_policy);
+ flow_mgr->init(dpp, sync_policy);
- reflect(&source_pipes,
+ reflect(dpp, &source_pipes,
&target_pipes,
&sources,
&targets,
return 0;
}
-void RGWBucketSyncPolicyHandler::reflect(RGWBucketSyncFlowManager::pipe_set *psource_pipes,
+void RGWBucketSyncPolicyHandler::reflect(const DoutPrefixProvider *dpp, RGWBucketSyncFlowManager::pipe_set *psource_pipes,
RGWBucketSyncFlowManager::pipe_set *ptarget_pipes,
map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *psources,
map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *ptargets,
std::set<rgw_zone_id> _source_zones;
std::set<rgw_zone_id> _target_zones;
- flow_mgr->reflect(bucket, &_source_pipes, &_target_pipes, only_enabled);
+ flow_mgr->reflect(dpp, bucket, &_source_pipes, &_target_pipes, only_enabled);
for (auto& entry : _source_pipes.pipe_map) {
auto& pipe = entry.second;
std::optional<rgw_bucket> b) const;
template <typename CB>
- void init(CephContext *cct,
+ void init(const DoutPrefixProvider *dpp, CephContext *cct,
const rgw_zone_id& _zone,
std::optional<rgw_bucket> _bucket,
const rgw_sync_policy_group& group,
*/
void update_flow_maps(const rgw_sync_bucket_pipes& pipe);
- void init(const rgw_sync_policy_info& sync_policy);
+ void init(const DoutPrefixProvider *dpp, const rgw_sync_policy_info& sync_policy);
public:
std::optional<rgw_bucket> _bucket,
const RGWBucketSyncFlowManager *_parent);
- void reflect(std::optional<rgw_bucket> effective_bucket,
+ void reflect(const DoutPrefixProvider *dpp, std::optional<rgw_bucket> effective_bucket,
pipe_set *flow_by_source,
pipe_set *flow_by_dest,
bool only_enabled) const;
int init(const DoutPrefixProvider *dpp, optional_yield y);
- void reflect(RGWBucketSyncFlowManager::pipe_set *psource_pipes,
+ void reflect(const DoutPrefixProvider *dpp, RGWBucketSyncFlowManager::pipe_set *psource_pipes,
RGWBucketSyncFlowManager::pipe_set *ptarget_pipes,
map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *psources,
map<rgw_zone_id, RGWBucketSyncFlowManager::pipe_set> *ptargets,
TracepointProvider::initialize<rgw_rados_tracepoint_traits>(g_ceph_context);
TracepointProvider::initialize<rgw_op_tracepoint_traits>(g_ceph_context);
- int r = rgw_tools_init(g_ceph_context);
+ const DoutPrefix dp(cct.get(), dout_subsys, "rgw main: ");
+ int r = rgw_tools_init(&dp, g_ceph_context);
if (r < 0) {
derr << "ERROR: unable to initialize rgw tools" << dendl;
return -r;
rgw_http_client_init(g_ceph_context);
rgw_kmip_client_init(*new RGWKMIPManagerImpl(g_ceph_context));
- const DoutPrefix dp(cct.get(), dout_subsys, "rgw main: ");
rgw::sal::Store* store =
StoreManager::get_storage(&dp, g_ceph_context,
"rados",
JSONParser parser;
r = parser.parse(data.c_str(), data.length());
if (r < 0) {
- lderr(conn->get_ctx()) << "request failed: " << cpp_strerror(-r) << dendl;
+ ldpp_dout(dpp, -1) << "request failed: " << cpp_strerror(-r) << dendl;
return r;
}
try {
decode_json_obj(period, &parser);
} catch (const JSONDecoder::err& e) {
- lderr(conn->get_ctx()) << "failed to decode JSON input: "
+ ldpp_dout(dpp, -1) << "failed to decode JSON input: "
<< e.what() << dendl;
return -EINVAL;
}
const rgw_bucket& b = bs->bucket;
std::string bucket_id = b.get_key();
RGWBucketReshardLock reshard_lock(this->store, bucket_info, true);
- ret = reshard_lock.lock();
+ ret = reshard_lock.lock(dpp);
if (ret < 0) {
ldpp_dout(dpp, 20) << __func__ <<
" INFO: failed to take reshard lock for bucket " <<
int RGWBucketReshard::cancel(const DoutPrefixProvider *dpp)
{
- int ret = reshard_lock.lock();
+ int ret = reshard_lock.lock(dpp);
if (ret < 0) {
return ret;
}
internal_lock.set_duration(duration);
}
-int RGWBucketReshardLock::lock() {
+int RGWBucketReshardLock::lock(const DoutPrefixProvider *dpp) {
internal_lock.set_must_renew(false);
int ret;
" to be held by another RGW process; skipping for now" << dendl;
return ret;
} else if (ret < 0) {
- lderr(store->ctx()) << "ERROR: RGWReshardLock::" << __func__ <<
+ ldpp_dout(dpp, -1) << "ERROR: RGWReshardLock::" << __func__ <<
" failed to acquire lock on " << lock_oid << ": " <<
cpp_strerror(-ret) << dendl;
return ret;
bool verbose, ostream *out, Formatter *formatter,
RGWReshard* reshard_log)
{
- int ret = reshard_lock.lock();
+ int ret = reshard_lock.lock(dpp);
if (ret < 0) {
return ret;
}
entry.bucket_id = bucket_info.bucket.bucket_id;
entry.tenant = bucket_info.owner.tenant;
- int ret = get(entry);
+ int ret = get(dpp, entry);
if (ret < 0) {
return ret;
}
}
-int RGWReshard::list(int logshard_num, string& marker, uint32_t max, std::list<cls_rgw_reshard_entry>& entries, bool *is_truncated)
+int RGWReshard::list(const DoutPrefixProvider *dpp, int logshard_num, string& marker, uint32_t max, std::list<cls_rgw_reshard_entry>& entries, bool *is_truncated)
{
string logshard_oid;
int ret = cls_rgw_reshard_list(store->getRados()->reshard_pool_ctx, logshard_oid, marker, max, entries, is_truncated);
if (ret < 0) {
- lderr(store->ctx()) << "ERROR: failed to list reshard log entries, oid=" << logshard_oid << " "
+ ldpp_dout(dpp, -1) << "ERROR: failed to list reshard log entries, oid=" << logshard_oid << " "
<< "marker=" << marker << " " << cpp_strerror(ret) << dendl;
if (ret == -ENOENT) {
*is_truncated = false;
ret = 0;
} else {
if (ret == -EACCES) {
- lderr(store->ctx()) << "access denied to pool " << store->svc()->zone->get_zone_params().reshard_pool
+ ldpp_dout(dpp, -1) << "access denied to pool " << store->svc()->zone->get_zone_params().reshard_pool
<< ". Fix the pool access permissions of your client" << dendl;
}
}
return ret;
}
-int RGWReshard::get(cls_rgw_reshard_entry& entry)
+int RGWReshard::get(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry)
{
string logshard_oid;
int ret = cls_rgw_reshard_get(store->getRados()->reshard_pool_ctx, logshard_oid, entry);
if (ret < 0) {
if (ret != -ENOENT) {
- lderr(store->ctx()) << "ERROR: failed to get entry from reshard log, oid=" << logshard_oid << " tenant=" << entry.tenant <<
+ ldpp_dout(dpp, -1) << "ERROR: failed to get entry from reshard log, oid=" << logshard_oid << " tenant=" << entry.tenant <<
" bucket=" << entry.bucket_name << dendl;
}
return ret;
return ret;
}
-int RGWReshard::clear_bucket_resharding(const string& bucket_instance_oid, cls_rgw_reshard_entry& entry)
+int RGWReshard::clear_bucket_resharding(const DoutPrefixProvider *dpp, const string& bucket_instance_oid, cls_rgw_reshard_entry& entry)
{
int ret = cls_rgw_clear_bucket_resharding(store->getRados()->reshard_pool_ctx, bucket_instance_oid);
if (ret < 0) {
- lderr(store->ctx()) << "ERROR: failed to clear bucket resharding, bucket_instance_oid=" << bucket_instance_oid << dendl;
+ ldpp_dout(dpp, -1) << "ERROR: failed to clear bucket resharding, bucket_instance_oid=" << bucket_instance_oid << dendl;
return ret;
}
RGWBucketReshardLock logshard_lock(store, logshard_oid, false);
- int ret = logshard_lock.lock();
+ int ret = logshard_lock.lock(dpp);
if (ret < 0) {
ldpp_dout(dpp, 5) << __func__ << "(): failed to acquire lock on " <<
logshard_oid << ", ret = " << ret <<dendl;
do {
std::list<cls_rgw_reshard_entry> entries;
- ret = list(logshard_num, marker, max_entries, entries, &truncated);
+ ret = list(dpp, logshard_num, marker, max_entries, entries, &truncated);
if (ret < 0) {
ldpp_dout(dpp, 10) << "cannot list all reshards in logshard oid=" <<
logshard_oid << dendl;
RGWBucketReshardLock(_store, bucket_info.bucket.get_key(':'), _ephemeral)
{}
- int lock();
+ int lock(const DoutPrefixProvider *dpp);
void unlock();
int renew(const Clock::time_point&);
RGWReshard(rgw::sal::RadosStore* _store, bool _verbose = false, ostream *_out = nullptr, Formatter *_formatter = nullptr);
int add(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
int update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucket_info, const RGWBucketInfo& new_bucket_info);
- int get(cls_rgw_reshard_entry& entry);
+ int get(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
int remove(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry);
- int list(int logshard_num, string& marker, uint32_t max, std::list<cls_rgw_reshard_entry>& entries, bool *is_truncated);
- int clear_bucket_resharding(const string& bucket_instance_oid, cls_rgw_reshard_entry& entry);
+ int list(const DoutPrefixProvider *dpp, int logshard_num, string& marker, uint32_t max, std::list<cls_rgw_reshard_entry>& entries, bool *is_truncated);
+ int clear_bucket_resharding(const DoutPrefixProvider *dpp, const string& bucket_instance_oid, cls_rgw_reshard_entry& entry);
/* reshard thread */
int process_single_logshard(int logshard_num, const DoutPrefixProvider *dpp);
RGWPubSub::Bucket ps_bucket(&ps, info.bucket);
const auto ps_ret = ps_bucket.remove_notifications(dpp, y);
if (ps_ret < 0 && ps_ret != -ENOENT) {
- lderr(store->ctx()) << "ERROR: unable to remove notifications from bucket. ret=" << ps_ret << dendl;
+ ldpp_dout(dpp, -1) << "ERROR: unable to remove notifications from bucket. ret=" << ps_ret << dendl;
}
ret = store->ctl()->bucket->unlink_bucket(info.owner, info.bucket, y, dpp, false);
}
if (!(static_cast<RGWAWSStreamPutCRF *>(out_crf.get()))->get_etag(petag)) {
- ldout(sc->cct, 0) << "ERROR: failed to get etag from PUT request" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to get etag from PUT request" << dendl;
return set_cr_error(-EIO);
}
*/
RGWXMLDecoder::XMLParser parser;
if (!parser.init()) {
- ldout(sc->cct, 0) << "ERROR: failed to initialize xml parser for parsing multipart init response from server" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to initialize xml parser for parsing multipart init response from server" << dendl;
return set_cr_error(-EIO);
}
if (!parser.parse(out_bl.c_str(), out_bl.length(), 1)) {
string str(out_bl.c_str(), out_bl.length());
- ldout(sc->cct, 5) << "ERROR: failed to parse xml: " << str << dendl;
+ ldpp_dout(dpp, 5) << "ERROR: failed to parse xml: " << str << dendl;
return set_cr_error(-EIO);
}
RGWXMLDecoder::decode_xml("InitiateMultipartUploadResult", result, &parser, true);
} catch (RGWXMLDecoder::err& err) {
string str(out_bl.c_str(), out_bl.length());
- ldout(sc->cct, 5) << "ERROR: unexpected xml: " << str << dendl;
+ ldpp_dout(dpp, 5) << "ERROR: unexpected xml: " << str << dendl;
return set_cr_error(-EIO);
}
}
*/
RGWXMLDecoder::XMLParser parser;
if (!parser.init()) {
- ldout(sc->cct, 0) << "ERROR: failed to initialize xml parser for parsing multipart init response from server" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to initialize xml parser for parsing multipart init response from server" << dendl;
return set_cr_error(-EIO);
}
if (!parser.parse(out_bl.c_str(), out_bl.length(), 1)) {
string str(out_bl.c_str(), out_bl.length());
- ldout(sc->cct, 5) << "ERROR: failed to parse xml: " << str << dendl;
+ ldpp_dout(dpp, 5) << "ERROR: failed to parse xml: " << str << dendl;
return set_cr_error(-EIO);
}
RGWXMLDecoder::decode_xml("CompleteMultipartUploadResult", result, &parser, true);
} catch (RGWXMLDecoder::err& err) {
string str(out_bl.c_str(), out_bl.length());
- ldout(sc->cct, 5) << "ERROR: unexpected xml: " << str << dendl;
+ ldpp_dout(dpp, 5) << "ERROR: unexpected xml: " << str << dendl;
return set_cr_error(-EIO);
}
}
ldpp_dout(dpp, 0) << "ERROR: failed to store multipart upload state, retcode=" << retcode << dendl;
/* continue with upload anyway */
}
- ldout(sc->cct, 20) << "sync of object=" << src_obj << " via multipart upload, finished sending part #" << status.cur_part << " etag=" << pcur_part_info->etag << dendl;
+ ldpp_dout(dpp, 20) << "sync of object=" << src_obj << " via multipart upload, finished sending part #" << status.cur_part << " etag=" << pcur_part_info->etag << dendl;
}
yield call(new RGWAWSCompleteMultipartCR(sc, target->conn.get(), dest_obj, status.upload_id, status.parts));
reenter(this) {
ret = decode_attr(attrs, RGW_ATTR_PG_VER, &src_pg_ver, (uint64_t)0);
if (ret < 0) {
- ldout(sc->cct, 0) << "ERROR: failed to decode pg ver attr, ignoring" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to decode pg ver attr, ignoring" << dendl;
} else {
ret = decode_attr(attrs, RGW_ATTR_SOURCE_ZONE, &src_zone_short_id, (uint32_t)0);
if (ret < 0) {
- ldout(sc->cct, 0) << "ERROR: failed to decode source zone short_id attr, ignoring" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to decode source zone short_id attr, ignoring" << dendl;
src_pg_ver = 0; /* all or nothing */
}
}
source_conn = sync_env->svc->zone->get_zone_conn(sc->source_zone);
if (!source_conn) {
- ldout(sc->cct, 0) << "ERROR: cannot find http connection to zone " << sc->source_zone << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: cannot find http connection to zone " << sc->source_zone << dendl;
return set_cr_error(-EINVAL);
}
if (bucket_created.find(target_bucket_name) == bucket_created.end()){
yield {
- ldout(sc->cct,0) << "AWS: creating bucket " << target_bucket_name << dendl;
+ ldpp_dout(dpp, 0) << "AWS: creating bucket " << target_bucket_name << dendl;
bufferlist bl;
call(new RGWPutRawRESTResourceCR <bufferlist> (sc->cct, target->conn.get(),
sync_env->http_manager,
if (retcode < 0 ) {
RGWXMLDecoder::XMLParser parser;
if (!parser.init()) {
- ldout(sc->cct, 0) << "ERROR: failed to initialize xml parser for parsing multipart init response from server" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to initialize xml parser for parsing multipart init response from server" << dendl;
return set_cr_error(retcode);
}
if (!parser.parse(out_bl.c_str(), out_bl.length(), 1)) {
string str(out_bl.c_str(), out_bl.length());
- ldout(sc->cct, 5) << "ERROR: failed to parse xml: " << str << dendl;
+ ldpp_dout(dpp, 5) << "ERROR: failed to parse xml: " << str << dendl;
return set_cr_error(retcode);
}
RGWXMLDecoder::decode_xml("Error", result, &parser, true);
} catch (RGWXMLDecoder::err& err) {
string str(out_bl.c_str(), out_bl.length());
- ldout(sc->cct, 5) << "ERROR: unexpected xml: " << str << dendl;
+ ldpp_dout(dpp, 5) << "ERROR: unexpected xml: " << str << dendl;
return set_cr_error(retcode);
}
rgw_rest_obj rest_obj;
rest_obj.init(key);
if (do_decode_rest_obj(sc->cct, attrs, headers, &rest_obj)) {
- ldout(sc->cct, 0) << "ERROR: failed to decode rest obj out of headers=" << headers << ", attrs=" << attrs << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to decode rest obj out of headers=" << headers << ", attrs=" << attrs << dendl;
return set_cr_error(-EINVAL);
}
call(new RGWAWSStreamObjToCloudMultipartCR(sc, sync_pipe, instance.conf, source_conn, &src_obj,
mtime(_mtime), instance(_instance) {}
int operate(const DoutPrefixProvider *dpp) override {
reenter(this) {
- ldout(sc->cct, 0) << ": remove remote obj: z=" << sc->source_zone
+ ldpp_dout(dpp, 0) << ": remove remote obj: z=" << sc->source_zone
<< " b=" <<sync_pipe.info.source_bs.bucket << " k=" << key << " mtime=" << mtime << dendl;
yield {
instance.get_profile(sync_pipe.info.source_bs.bucket, &target);
string path = instance.conf.get_path(target, sync_pipe.dest_bucket_info, key);
- ldout(sc->cct, 0) << "AWS: removing aws object at" << path << dendl;
+ ldpp_dout(dpp, 0) << "AWS: removing aws object at" << path << dendl;
call(new RGWDeleteRESTResourceCR(sc->cct, target->conn.get(),
sc->env->http_manager,
}
}
-static int ext_mime_map_init(CephContext *cct, const char *ext_map)
+static int ext_mime_map_init(const DoutPrefixProvider *dpp, CephContext *cct, const char *ext_map)
{
int fd = open(ext_map, O_RDONLY);
char *buf = NULL;
int ret;
if (fd < 0) {
ret = -errno;
- ldout(cct, 0) << __func__ << " failed to open file=" << ext_map
+ ldpp_dout(dpp, 0) << __func__ << " failed to open file=" << ext_map
<< " : " << cpp_strerror(-ret) << dendl;
return ret;
}
ret = fstat(fd, &st);
if (ret < 0) {
ret = -errno;
- ldout(cct, 0) << __func__ << " failed to stat file=" << ext_map
+ ldpp_dout(dpp, 0) << __func__ << " failed to stat file=" << ext_map
<< " : " << cpp_strerror(-ret) << dendl;
goto done;
}
buf = (char *)malloc(st.st_size + 1);
if (!buf) {
ret = -ENOMEM;
- ldout(cct, 0) << __func__ << " failed to allocate buf" << dendl;
+ ldpp_dout(dpp, 0) << __func__ << " failed to allocate buf" << dendl;
goto done;
}
ret = safe_read(fd, buf, st.st_size + 1);
if (ret != st.st_size) {
// huh? file size has changed?
- ldout(cct, 0) << __func__ << " raced! will retry.." << dendl;
+ ldpp_dout(dpp, 0) << __func__ << " raced! will retry.." << dendl;
free(buf);
close(fd);
- return ext_mime_map_init(cct, ext_map);
+ return ext_mime_map_init(dpp, cct, ext_map);
}
buf[st.st_size] = '\0';
if (compression_type != "none") {
plugin = Compressor::create(store->ctx(), compression_type);
if (!plugin) {
- ldout(store->ctx(), 1) << "Cannot load plugin for compression type "
+ ldpp_dout(dpp, 1) << "Cannot load plugin for compression type "
<< compression_type << dendl;
} else {
compressor.emplace(store->ctx(), plugin, filter);
policy.encode(aclbl.emplace());
}
-int rgw_tools_init(CephContext *cct)
+int rgw_tools_init(const DoutPrefixProvider *dpp, CephContext *cct)
{
ext_mime_map = new std::map<std::string, std::string>;
- ext_mime_map_init(cct, cct->_conf->rgw_mime_types_file.c_str());
+ ext_mime_map_init(dpp, cct, cct->_conf->rgw_mime_types_file.c_str());
// ignore errors; missing mime.types is not fatal
return 0;
}
bufferlist& bl, uint64_t timeout_ms, bufferlist* pbl,
optional_yield y);
-int rgw_tools_init(CephContext *cct);
+int rgw_tools_init(const DoutPrefixProvider *dpp, CephContext *cct);
void rgw_tools_cleanup();
template<class H, size_t S>
if (!found_version ||
(refresh_version &&
e->info.objv_tracker.read_version.compare(&(*refresh_version)))) {
- lderr(cct) << "WARNING: The bucket info cache is inconsistent. This is "
+ ldpp_dout(dpp, -1) << "WARNING: The bucket info cache is inconsistent. This is "
<< "a failure that should be debugged. I am a nice machine, "
<< "so I will try to recover." << dendl;
binfo_cache->invalidate(cache_key);
set<rgw_zone_id> source_zones;
set<rgw_zone_id> target_zones;
- zone_policy_handler->reflect(nullptr, nullptr,
+ zone_policy_handler->reflect(dpp, nullptr, nullptr,
nullptr, nullptr,
&source_zones,
&target_zones,
obj.notify_ack(notify_id, cookie, reply_bl);
}
void handle_error(uint64_t cookie, int err) override {
- lderr(cct) << "RGWWatcher::handle_error cookie " << cookie
+ ldpp_dout(this, -1) << "RGWWatcher::handle_error cookie " << cookie
<< " err " << cpp_strerror(err) << dendl;
svc->remove_watcher(index);
svc->schedule_context(new C_ReinitWatch(this));
int ret = init_watch(dpp, y);
if (ret < 0) {
- lderr(cct) << "ERROR: failed to initialize watch: " << cpp_strerror(-ret) << dendl;
+ ldpp_dout(dpp, -1) << "ERROR: failed to initialize watch: " << cpp_strerror(-ret) << dendl;
return ret;
}
int ret = sync_modules_manager->create_instance(cct, zone_public_config.tier_type, svc.zone->get_zone_params().tier_config, &sync_module);
if (ret < 0) {
- lderr(cct) << "ERROR: failed to start sync module instance, ret=" << ret << dendl;
+ ldpp_dout(dpp, -1) << "ERROR: failed to start sync module instance, ret=" << ret << dendl;
if (ret == -ENOENT) {
- lderr(cct) << "ERROR: " << zone_public_config.tier_type
+ ldpp_dout(dpp, -1) << "ERROR: " << zone_public_config.tier_type
<< " sync module does not exist. valid sync modules: "
<< sync_modules_manager->get_registered_module_names()
<< dendl;
auto iter = bl.cbegin();
decode(info, iter);
} catch (buffer::end_of_buffer& err) {
- ldout(cct, 0) << "ERROR: got bad notification" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: got bad notification" << dendl;
return -EIO;
} catch (buffer::error& err) {
- ldout(cct, 0) << "ERROR: buffer::error" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: buffer::error" << dendl;
return -EIO;
}
cache.remove(dpp, name);
break;
default:
- ldout(cct, 0) << "WARNING: got unknown notification op: " << info.op << dendl;
+ ldpp_dout(dpp, 0) << "WARNING: got unknown notification op: " << info.op << dendl;
return -EINVAL;
}
set<rgw_zone_id> source_zones;
set<rgw_zone_id> target_zones;
- sync_policy_handler->reflect(nullptr, nullptr,
+ sync_policy_handler->reflect(dpp, nullptr, nullptr,
nullptr, nullptr,
&source_zones,
&target_zones,