diff options
author | Kalpesh Pandya <kapandya@redhat.com> | 2021-06-16 10:33:52 +0200 |
---|---|---|
committer | Kalpesh Pandya <kapandya@redhat.com> | 2021-07-02 04:11:20 +0200 |
commit | 3a9b43a9356968d9d05abe48cfcaefaacbf65177 (patch) | |
tree | 3be4c779fbd8332c08410523e573ea1d787178fd /src | |
parent | Merge PR #41935 into master (diff) | |
download | ceph-3a9b43a9356968d9d05abe48cfcaefaacbf65177.tar.xz ceph-3a9b43a9356968d9d05abe48cfcaefaacbf65177.zip |
rgw: DPP addition 3
Following files have been covered in this PR:
1. rgw_period_puller.cc
2. rgw_reshard.cc
3. rgw_sal_rados.cc
4. services/svc_sync_modules.cc
5. services/svc_bucket_sobj.cc
6. services/svc_notify.cc
7. rgw_acl_swift.cc
8. rgw_acl.cc
9. rgw_sync_module_aws.cc
10. rgw_tools.cc
11. services/svc_sys_obj_cache.cc
12. rgw_bucket_sync.cc
Signed-off-by: Kalpesh Pandya <kapandya@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/rgw/librgw.cc | 2 | ||||
-rw-r--r-- | src/rgw/rgw_acl.cc | 9 | ||||
-rw-r--r-- | src/rgw/rgw_acl.h | 2 | ||||
-rw-r--r-- | src/rgw/rgw_acl_swift.cc | 14 | ||||
-rw-r--r-- | src/rgw/rgw_admin.cc | 4 | ||||
-rw-r--r-- | src/rgw/rgw_bucket.cc | 2 | ||||
-rw-r--r-- | src/rgw/rgw_bucket_sync.cc | 26 | ||||
-rw-r--r-- | src/rgw/rgw_bucket_sync.h | 8 | ||||
-rw-r--r-- | src/rgw/rgw_main.cc | 4 | ||||
-rw-r--r-- | src/rgw/rgw_period_puller.cc | 4 | ||||
-rw-r--r-- | src/rgw/rgw_rados.cc | 2 | ||||
-rw-r--r-- | src/rgw/rgw_reshard.cc | 28 | ||||
-rw-r--r-- | src/rgw/rgw_reshard.h | 8 | ||||
-rw-r--r-- | src/rgw/rgw_sal_rados.cc | 2 | ||||
-rw-r--r-- | src/rgw/rgw_sync_module_aws.cc | 36 | ||||
-rw-r--r-- | src/rgw/rgw_tools.cc | 18 | ||||
-rw-r--r-- | src/rgw/rgw_tools.h | 2 | ||||
-rw-r--r-- | src/rgw/services/svc_bucket_sobj.cc | 2 | ||||
-rw-r--r-- | src/rgw/services/svc_bucket_sync_sobj.cc | 2 | ||||
-rw-r--r-- | src/rgw/services/svc_notify.cc | 4 | ||||
-rw-r--r-- | src/rgw/services/svc_sync_modules.cc | 4 | ||||
-rw-r--r-- | src/rgw/services/svc_sys_obj_cache.cc | 6 | ||||
-rw-r--r-- | src/rgw/services/svc_zone.cc | 2 |
23 files changed, 97 insertions, 94 deletions
diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index 7d43662abdd..1277d507966 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -518,7 +518,7 @@ namespace rgw { 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); diff --git a/src/rgw/rgw_acl.cc b/src/rgw/rgw_acl.cc index ec5de88cecb..a87cd8e2b1e 100644 --- a/src/rgw/rgw_acl.cc +++ b/src/rgw/rgw_acl.cc @@ -150,11 +150,12 @@ uint32_t RGWAccessControlList::get_group_perm(const DoutPrefixProvider *dpp, 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 @@ -168,7 +169,7 @@ uint32_t RGWAccessControlList::get_referer_perm(const uint32_t current_perm, } } - ldout(cct, 5) << "Found referer permission=" << referer_perm << dendl; + ldpp_dout(dpp, 5) << "Found referer permission=" << referer_perm << dendl; return referer_perm & perm_mask; } @@ -203,7 +204,7 @@ uint32_t RGWAccessControlPolicy::get_perm(const DoutPrefixProvider* dpp, /* 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 diff --git a/src/rgw/rgw_acl.h b/src/rgw/rgw_acl.h index dd6db08fbe0..89257fe783d 100644 --- a/src/rgw/rgw_acl.h +++ b/src/rgw/rgw_acl.h @@ -337,7 +337,7 @@ public: 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 { diff --git a/src/rgw/rgw_acl_swift.cc b/src/rgw/rgw_acl_swift.cc index fcc6a3a65fd..175590caac0 100644 --- a/src/rgw/rgw_acl_swift.cc +++ b/src/rgw/rgw_acl_swift.cc @@ -124,7 +124,7 @@ static ACLGrant user_to_grant(const DoutPrefixProvider *dpp, 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 { @@ -201,7 +201,7 @@ int RGWAccessControlPolicy_SWIFT::create(const DoutPrefixProvider *dpp, 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; } @@ -218,7 +218,7 @@ int RGWAccessControlPolicy_SWIFT::create(const DoutPrefixProvider *dpp, 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; } @@ -317,7 +317,7 @@ void RGWAccessControlPolicy_SWIFTAcct::add_grants(const DoutPrefixProvider *dpp, 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); @@ -350,7 +350,7 @@ bool RGWAccessControlPolicy_SWIFTAcct::create(const DoutPrefixProvider *dpp, 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); } @@ -359,7 +359,7 @@ bool RGWAccessControlPolicy_SWIFTAcct::create(const DoutPrefixProvider *dpp, 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); } @@ -368,7 +368,7 @@ bool RGWAccessControlPolicy_SWIFTAcct::create(const DoutPrefixProvider *dpp, 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); } diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 99f7656971a..fdf7a393f9d 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -2446,7 +2446,7 @@ static int sync_info(std::optional<rgw_zone_id> opt_target_zone, std::optional<r 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, @@ -6988,7 +6988,7 @@ next: 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; diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index f03d3919a54..4971846634f 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1549,7 +1549,7 @@ void get_stale_instances(rgw::sal::Store* store, const std::string& bucket_name, // 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__ diff --git a/src/rgw/rgw_bucket_sync.cc b/src/rgw/rgw_bucket_sync.cc index 357b56d9a40..30449e49008 100644 --- a/src/rgw/rgw_bucket_sync.cc +++ b/src/rgw/rgw_bucket_sync.cc @@ -141,7 +141,8 @@ pair<zb_pipe_map_t::const_iterator, zb_pipe_map_t::const_iterator> rgw_sync_grou 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, @@ -164,7 +165,7 @@ void rgw_sync_group_pipe_map::init(CephContext *cct, /* 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); } } @@ -519,7 +520,7 @@ bool RGWBucketSyncFlowManager::allowed_data_flow(const rgw_zone_id& source_zone, 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(); @@ -530,7 +531,7 @@ void RGWBucketSyncFlowManager::init(const rgw_sync_policy_info& sync_policy) { 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, @@ -549,7 +550,8 @@ void RGWBucketSyncFlowManager::init(const rgw_sync_policy_info& sync_policy) { } } -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 @@ -560,7 +562,7 @@ void RGWBucketSyncFlowManager::reflect(std::optional<rgw_bucket> effective_bucke 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) { @@ -581,7 +583,7 @@ void RGWBucketSyncFlowManager::reflect(std::optional<rgw_bucket> effective_bucke 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); } @@ -595,7 +597,7 @@ void RGWBucketSyncFlowManager::reflect(std::optional<rgw_bucket> effective_bucke 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); } } @@ -746,9 +748,9 @@ int RGWBucketSyncPolicyHandler::init(const DoutPrefixProvider *dpp, optional_yie return r; } - flow_mgr->init(sync_policy); + flow_mgr->init(dpp, sync_policy); - reflect(&source_pipes, + reflect(dpp, &source_pipes, &target_pipes, &sources, &targets, @@ -759,7 +761,7 @@ int RGWBucketSyncPolicyHandler::init(const DoutPrefixProvider *dpp, optional_yie 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, @@ -774,7 +776,7 @@ void RGWBucketSyncPolicyHandler::reflect(RGWBucketSyncFlowManager::pipe_set *pso 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; diff --git a/src/rgw/rgw_bucket_sync.h b/src/rgw/rgw_bucket_sync.h index d1d09bbfc07..112f71abcc1 100644 --- a/src/rgw/rgw_bucket_sync.h +++ b/src/rgw/rgw_bucket_sync.h @@ -70,7 +70,7 @@ struct rgw_sync_group_pipe_map { 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, @@ -257,7 +257,7 @@ private: */ 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: @@ -266,7 +266,7 @@ 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; @@ -333,7 +333,7 @@ public: 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, diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 0e3c4973caf..6950b6c4a22 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -311,7 +311,8 @@ int radosgw_Main(int argc, const char **argv) 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; @@ -322,7 +323,6 @@ int radosgw_Main(int argc, const char **argv) 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", diff --git a/src/rgw/rgw_period_puller.cc b/src/rgw/rgw_period_puller.cc index 8e0df896957..ea2f28e567b 100644 --- a/src/rgw/rgw_period_puller.cc +++ b/src/rgw/rgw_period_puller.cc @@ -48,14 +48,14 @@ int pull_period(const DoutPrefixProvider *dpp, RGWRESTConn* conn, const std::str 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; } diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index e24ae308b49..c3f1a43370c 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -6777,7 +6777,7 @@ int RGWRados::block_while_resharding(RGWRados::BucketShard *bs, 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 " << diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index 2ff08df78e3..b4486beff6c 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -372,7 +372,7 @@ int RGWBucketReshard::create_new_bucket_instance(int new_num_shards, int RGWBucketReshard::cancel(const DoutPrefixProvider *dpp) { - int ret = reshard_lock.lock(); + int ret = reshard_lock.lock(dpp); if (ret < 0) { return ret; } @@ -473,7 +473,7 @@ RGWBucketReshardLock::RGWBucketReshardLock(rgw::sal::RadosStore* _store, internal_lock.set_duration(duration); } -int RGWBucketReshardLock::lock() { +int RGWBucketReshardLock::lock(const DoutPrefixProvider *dpp) { internal_lock.set_must_renew(false); int ret; @@ -490,7 +490,7 @@ int RGWBucketReshardLock::lock() { " 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; @@ -711,7 +711,7 @@ int RGWBucketReshard::execute(int num_shards, int max_op_entries, 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; } @@ -862,7 +862,7 @@ int RGWReshard::update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucke 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; } @@ -879,7 +879,7 @@ int RGWReshard::update(const DoutPrefixProvider *dpp, const RGWBucketInfo& bucke } -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; @@ -888,14 +888,14 @@ int RGWReshard::list(int logshard_num, string& marker, uint32_t max, std::list<c 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; } } @@ -904,7 +904,7 @@ int RGWReshard::list(int logshard_num, string& marker, uint32_t max, std::list<c return ret; } -int RGWReshard::get(cls_rgw_reshard_entry& entry) +int RGWReshard::get(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& entry) { string logshard_oid; @@ -913,7 +913,7 @@ int RGWReshard::get(cls_rgw_reshard_entry& entry) 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; @@ -940,11 +940,11 @@ int RGWReshard::remove(const DoutPrefixProvider *dpp, cls_rgw_reshard_entry& ent 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; } @@ -1009,7 +1009,7 @@ int RGWReshard::process_single_logshard(int logshard_num, const DoutPrefixProvid 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; @@ -1018,7 +1018,7 @@ int RGWReshard::process_single_logshard(int logshard_num, const DoutPrefixProvid 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; diff --git a/src/rgw/rgw_reshard.h b/src/rgw/rgw_reshard.h index 23970c93ea2..67205bb71c3 100644 --- a/src/rgw/rgw_reshard.h +++ b/src/rgw/rgw_reshard.h @@ -55,7 +55,7 @@ public: RGWBucketReshardLock(_store, bucket_info.bucket.get_key(':'), _ephemeral) {} - int lock(); + int lock(const DoutPrefixProvider *dpp); void unlock(); int renew(const Clock::time_point&); @@ -237,10 +237,10 @@ public: 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); diff --git a/src/rgw/rgw_sal_rados.cc b/src/rgw/rgw_sal_rados.cc index c77fee75a61..d1aa04fbe8d 100644 --- a/src/rgw/rgw_sal_rados.cc +++ b/src/rgw/rgw_sal_rados.cc @@ -288,7 +288,7 @@ int RadosBucket::remove_bucket(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); diff --git a/src/rgw/rgw_sync_module_aws.cc b/src/rgw/rgw_sync_module_aws.cc index 69128dc1ad1..065c2cc7012 100644 --- a/src/rgw/rgw_sync_module_aws.cc +++ b/src/rgw/rgw_sync_module_aws.cc @@ -1108,7 +1108,7 @@ public: } 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); } @@ -1218,13 +1218,13 @@ public: */ 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); } @@ -1232,7 +1232,7 @@ public: 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); } } @@ -1329,13 +1329,13 @@ public: */ 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); } @@ -1343,7 +1343,7 @@ public: 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); } } @@ -1517,7 +1517,7 @@ public: 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)); @@ -1608,11 +1608,11 @@ public: 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 */ } } @@ -1624,7 +1624,7 @@ public: 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); } @@ -1633,7 +1633,7 @@ public: 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, @@ -1642,13 +1642,13 @@ public: 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); } @@ -1656,7 +1656,7 @@ public: 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); } @@ -1696,7 +1696,7 @@ public: 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, @@ -1749,12 +1749,12 @@ public: 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, diff --git a/src/rgw/rgw_tools.cc b/src/rgw/rgw_tools.cc index ad8382f6947..1a3d33f7f52 100644 --- a/src/rgw/rgw_tools.cc +++ b/src/rgw/rgw_tools.cc @@ -344,14 +344,14 @@ void parse_mime_map(const char *buf) } } -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; } @@ -360,7 +360,7 @@ static int ext_mime_map_init(CephContext *cct, const char *ext_map) 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; } @@ -368,17 +368,17 @@ static int ext_mime_map_init(CephContext *cct, const char *ext_map) 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'; @@ -506,7 +506,7 @@ int RGWDataAccess::Object::put(bufferlist& data, 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); @@ -583,10 +583,10 @@ void RGWDataAccess::Object::set_policy(const RGWAccessControlPolicy& policy) 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; } diff --git a/src/rgw/rgw_tools.h b/src/rgw/rgw_tools.h index 0d96d44edce..218a8c01bd3 100644 --- a/src/rgw/rgw_tools.h +++ b/src/rgw/rgw_tools.h @@ -102,7 +102,7 @@ int rgw_rados_notify(const DoutPrefixProvider *dpp, librados::IoCtx& ioctx, cons 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> diff --git a/src/rgw/services/svc_bucket_sobj.cc b/src/rgw/services/svc_bucket_sobj.cc index ce9d55b011b..f4086e8bd0d 100644 --- a/src/rgw/services/svc_bucket_sobj.cc +++ b/src/rgw/services/svc_bucket_sobj.cc @@ -400,7 +400,7 @@ int RGWSI_Bucket_SObj::read_bucket_info(RGWSI_Bucket_X_Ctx& ctx, 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); diff --git a/src/rgw/services/svc_bucket_sync_sobj.cc b/src/rgw/services/svc_bucket_sync_sobj.cc index 88503344215..52cd64617c9 100644 --- a/src/rgw/services/svc_bucket_sync_sobj.cc +++ b/src/rgw/services/svc_bucket_sync_sobj.cc @@ -109,7 +109,7 @@ int RGWSI_Bucket_Sync_SObj::resolve_policy_hints(RGWSI_Bucket_X_Ctx& ctx, 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, diff --git a/src/rgw/services/svc_notify.cc b/src/rgw/services/svc_notify.cc index 25ccfdbfba7..6a048f61b55 100644 --- a/src/rgw/services/svc_notify.cc +++ b/src/rgw/services/svc_notify.cc @@ -67,7 +67,7 @@ public: 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)); @@ -265,7 +265,7 @@ int RGWSI_Notify::do_start(optional_yield y, const DoutPrefixProvider *dpp) 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; } diff --git a/src/rgw/services/svc_sync_modules.cc b/src/rgw/services/svc_sync_modules.cc index b5490660a4f..175df08a97b 100644 --- a/src/rgw/services/svc_sync_modules.cc +++ b/src/rgw/services/svc_sync_modules.cc @@ -22,9 +22,9 @@ int RGWSI_SyncModules::do_start(optional_yield, const DoutPrefixProvider *dpp) 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; diff --git a/src/rgw/services/svc_sys_obj_cache.cc b/src/rgw/services/svc_sys_obj_cache.cc index 68b90888121..b890e8757f4 100644 --- a/src/rgw/services/svc_sys_obj_cache.cc +++ b/src/rgw/services/svc_sys_obj_cache.cc @@ -447,10 +447,10 @@ int RGWSI_SysObj_Cache::watch_cb(const DoutPrefixProvider *dpp, 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; } @@ -467,7 +467,7 @@ int RGWSI_SysObj_Cache::watch_cb(const DoutPrefixProvider *dpp, 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; } diff --git a/src/rgw/services/svc_zone.cc b/src/rgw/services/svc_zone.cc index a9448b90cf2..321cf8781e4 100644 --- a/src/rgw/services/svc_zone.cc +++ b/src/rgw/services/svc_zone.cc @@ -184,7 +184,7 @@ int RGWSI_Zone::do_start(optional_yield y, const DoutPrefixProvider *dpp) 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, |