From 7cc860a95a6f4cb284ce2693fae201f7761e06d7 Mon Sep 17 00:00:00 2001 From: "J. Eric Ivancich" Date: Wed, 31 Aug 2022 16:38:06 -0400 Subject: [PATCH] rgw: simplify bucket listing logging Switch from __PRETTY_FUNCTION__ to __func__ since the former just adds noise to the logs. Signed-off-by: J. Eric Ivancich --- src/rgw/rgw_rados.cc | 88 ++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index d89be3fc166..d862e83a681 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -1826,12 +1826,12 @@ int RGWRados::Bucket::List::list_objects_ordered( rgw_obj_index_key prev_marker; for (uint16_t attempt = 1; /* empty */; ++attempt) { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": starting attempt " << attempt << dendl; if (attempt > 1 && !(prev_marker < cur_marker)) { // we've failed to make forward progress - ldpp_dout(dpp, 0) << "ERROR: " << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << "ERROR: " << __func__ << " marker failed to make forward progress; attempt=" << attempt << ", prev_marker=" << prev_marker << ", cur_marker=" << cur_marker << dendl; @@ -1866,7 +1866,7 @@ int RGWRados::Bucket::List::list_objects_ordered( rgw_obj_index_key index_key = entry.key; rgw_obj_key obj(index_key); - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": considering entry " << entry.key << dendl; /* note that parse_raw_oid() here will not set the correct @@ -1877,14 +1877,14 @@ int RGWRados::Bucket::List::list_objects_ordered( */ bool valid = rgw_obj_key::parse_raw_oid(index_key.name, &obj); if (!valid) { - ldpp_dout(dpp, 0) << "ERROR: " << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << "ERROR: " << __func__ << " could not parse object name: " << obj.name << dendl; continue; } bool matched_ns = (obj.ns == params.ns); if (!params.list_versions && !entry.is_visible()) { - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": skipping not visible entry \"" << entry.key << "\"" << dendl; continue; } @@ -1893,14 +1893,14 @@ int RGWRados::Bucket::List::list_objects_ordered( if (!params.ns.empty()) { /* we've iterated past the namespace we're searching -- done now */ truncated = false; - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": finished due to getting past requested namespace \"" << params.ns << "\"" << dendl; goto done; } /* we're skipping past namespaced objects */ - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skipping past namespaced objects, including \"" << entry.key << "\"" << dendl; continue; @@ -1908,7 +1908,7 @@ int RGWRados::Bucket::List::list_objects_ordered( if (cur_end_marker_valid && cur_end_marker <= index_key) { truncated = false; - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": finished due to gitting end marker of \"" << cur_end_marker << "\" with \"" << entry.key << "\"" << dendl; goto done; @@ -1921,7 +1921,7 @@ int RGWRados::Bucket::List::list_objects_ordered( if (params.access_list_filter && ! params.access_list_filter->filter(obj.name, index_key.name)) { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skipping past namespaced objects, including \"" << entry.key << "\"" << dendl; continue; @@ -1929,7 +1929,7 @@ int RGWRados::Bucket::List::list_objects_ordered( if (params.prefix.size() && 0 != obj.name.compare(0, params.prefix.size(), params.prefix)) { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skipping object \"" << entry.key << "\" that doesn't match prefix \"" << params.prefix << "\"" << dendl; continue; @@ -1947,7 +1947,7 @@ int RGWRados::Bucket::List::list_objects_ordered( // prefix if (delim_pos != int(obj.name.length() - params.delim.length())) { - ldpp_dout(dpp, 0) << "WARNING: " << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << "WARNING: " << __func__ << " found delimiter in place other than the end of " "the prefix; obj.name=" << obj.name << ", prefix=" << params.prefix << dendl; @@ -1955,7 +1955,7 @@ int RGWRados::Bucket::List::list_objects_ordered( if (common_prefixes) { if (count >= max) { truncated = true; - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": stopping early with common prefix \"" << entry.key << "\" because requested number (" << max << ") reached (cls filtered)" << dendl; @@ -1966,7 +1966,7 @@ int RGWRados::Bucket::List::list_objects_ordered( count++; } - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": finished entry with common prefix \"" << entry.key << "\" so continuing loop (cls filtered)" << dendl; continue; @@ -1985,7 +1985,7 @@ int RGWRados::Bucket::List::list_objects_ordered( common_prefixes->find(prefix_key) == common_prefixes->end()) { if (count >= max) { truncated = true; - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": stopping early with common prefix \"" << entry.key << "\" because requested number (" << max << ") reached (not cls filtered)" << dendl; @@ -1997,7 +1997,7 @@ int RGWRados::Bucket::List::list_objects_ordered( count++; } - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": finished entry with common prefix \"" << entry.key << "\" so continuing loop (not cls filtered)" << dendl; continue; @@ -2007,14 +2007,14 @@ int RGWRados::Bucket::List::list_objects_ordered( if (count >= max) { truncated = true; - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": stopping early with entry \"" << entry.key << "\" because requested number (" << max << ") reached" << dendl; goto done; } - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": adding entry " << entry.key << " to result" << dendl; result->emplace_back(std::move(entry)); @@ -2033,19 +2033,19 @@ int RGWRados::Bucket::List::list_objects_ordered( cur_marker.name.substr(0, marker_delim_pos); skip_after_delim.append(after_delim_s); - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skip_after_delim=" << skip_after_delim << dendl; if (skip_after_delim > cur_marker.name) { cur_marker = skip_after_delim; - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": setting cur_marker=" << cur_marker.name << "[" << cur_marker.instance << "]" << dendl; } } } // if older osd didn't do delimiter filtering - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": end of outer loop, truncated=" << truncated << ", count=" << count << ", attempt=" << attempt << dendl; @@ -2053,7 +2053,7 @@ int RGWRados::Bucket::List::list_objects_ordered( // if we finished listing, or if we're returning at least half the // requested entries, that's enough; S3 and swift protocols allow // returning fewer than max entries - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": exiting attempt loop because we reached end (" << truncated << ") or we're returning half the requested entries (" << count << " of " << max << ")" << dendl; @@ -2061,7 +2061,7 @@ int RGWRados::Bucket::List::list_objects_ordered( } else if (attempt > SOFT_MAX_ATTEMPTS && count >= 1) { // if we've made at least 8 attempts and we have some, but very // few, results, return with what we have - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": exiting attempt loop because we made " << attempt << " attempts and we're returning " << count << " entries" << dendl; break; @@ -2158,7 +2158,7 @@ int RGWRados::Bucket::List::list_objects_unordered(const DoutPrefixProvider *dpp &cur_marker, y); if (r < 0) { - ldpp_dout(dpp, 0) << "ERROR: " << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << "ERROR: " << __func__ << " cls_bucket_list_unordered returned " << r << " for " << target->get_bucket_info().bucket << dendl; return r; @@ -2185,20 +2185,20 @@ int RGWRados::Bucket::List::list_objects_unordered(const DoutPrefixProvider *dpp */ bool valid = rgw_obj_key::parse_raw_oid(index_key.name, &obj); if (!valid) { - ldpp_dout(dpp, 0) << "ERROR: " << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << "ERROR: " << __func__ << " could not parse object name: " << obj.name << dendl; continue; } if (!params.list_versions && !entry.is_visible()) { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skippping \"" << index_key << "\" because not listing versions and entry not visibile" << dendl; continue; } if (params.enforce_ns && obj.ns != params.ns) { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skippping \"" << index_key << "\" because namespace does not match" << dendl; continue; @@ -2207,7 +2207,7 @@ int RGWRados::Bucket::List::list_objects_unordered(const DoutPrefixProvider *dpp if (cur_end_marker_valid && cur_end_marker <= index_key) { // we're not guaranteed items will come in order, so we have // to loop through all - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skippping \"" << index_key << "\" because after end_marker" << dendl; continue; @@ -2215,7 +2215,7 @@ int RGWRados::Bucket::List::list_objects_unordered(const DoutPrefixProvider *dpp if (params.access_list_filter && !params.access_list_filter->filter(obj.name, index_key.name)) { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skippping \"" << index_key << "\" because doesn't match filter" << dendl; continue; @@ -2223,7 +2223,7 @@ int RGWRados::Bucket::List::list_objects_unordered(const DoutPrefixProvider *dpp if (params.prefix.size() && (0 != obj.name.compare(0, params.prefix.size(), params.prefix))) { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": skippping \"" << index_key << "\" because doesn't match prefix" << dendl; continue; @@ -8564,7 +8564,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, &index_pool, &shard_oids, nullptr); if (r < 0) { - ldpp_dout(dpp, 0) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << __func__ << ": open_bucket_index for " << bucket_info.bucket << " failed" << dendl; return r; } @@ -8584,7 +8584,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, num_entries_per_shard = num_entries; } - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": request from each of " << shard_count << " shard(s) for " << num_entries_per_shard << " entries to get " << num_entries << " total entries" << dendl; @@ -8597,7 +8597,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, list_versions, shard_oids, shard_list_results, cct->_conf->rgw_bucket_index_max_aio)(); if (r < 0) { - ldpp_dout(dpp, 0) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << __func__ << ": CLSRGWIssueBucketList for " << bucket_info.bucket << " failed" << dendl; return r; @@ -8699,7 +8699,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, const std::string& name = tracker.entry_name(); rgw_bucket_dir_entry& dirent = tracker.dir_entry(); - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << ": currently processing " << + ldpp_dout(dpp, 20) << __func__ << ": currently processing " << dirent.key << " from shard " << tracker.shard_idx << dendl; const bool force_check = @@ -8721,7 +8721,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, r = check_disk_state(dpp, sub_ctx, bucket_info, dirent, dirent, updates[tracker.oid_name], y); if (r < 0 && r != -ENOENT) { - ldpp_dout(dpp, 0) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << __func__ << ": check_disk_state for \"" << dirent.key << "\" failed with r=" << r << dendl; return r; @@ -8732,7 +8732,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, // at this point either r >= 0 or r == -ENOENT if (r >= 0) { // i.e., if r != -ENOENT - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << ": got " << + ldpp_dout(dpp, 10) << __func__ << ": got " << dirent.key << dendl; auto [it, inserted] = m.insert_or_assign(name, std::move(dirent)); @@ -8740,12 +8740,12 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, if (inserted) { ++count; } else { - ldpp_dout(dpp, 0) << "WARNING: " << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << "WARNING: " << __func__ << " reassigned map value at \"" << name << "\", which should not happen" << dendl; } } else { - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << ": skipping " << + ldpp_dout(dpp, 10) << __func__ << ": skipping " << dirent.key.name << "[" << dirent.key.instance << "]" << dendl; last_entry_visited = &tracker.dir_entry(); } @@ -8772,7 +8772,7 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, // as we cannot be certain that one of the next entries needs to // come from that shard; S3 and swift protocols allow returning // fewer than what was requested - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": stopped accumulating results at count=" << count << ", dirent=\"" << dirent.key << "\", because its shard is truncated and exhausted" << dendl; @@ -8806,28 +8806,28 @@ int RGWRados::cls_bucket_list_ordered(const DoutPrefixProvider *dpp, } } - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": returning, count=" << count << ", is_truncated=" << *is_truncated << dendl; if (*is_truncated && count < num_entries) { - ldpp_dout(dpp, 10) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 10) << __func__ << ": requested " << num_entries << " entries but returning " << count << ", which is truncated" << dendl; } if (last_entry_visited != nullptr && last_entry) { *last_entry = last_entry_visited->key; - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": returning, last_entry=" << *last_entry << dendl; } else { - ldpp_dout(dpp, 20) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 20) << __func__ << ": returning, last_entry NOT SET" << dendl; } ldout_bitx(bitx, dpp, 10) << "EXITING " << __func__ << dendl_bitx; return 0; -} +} // RGWRados::cls_bucket_list_ordered // A helper function to retrieve the hash source from an incomplete @@ -9337,7 +9337,7 @@ int RGWRados::check_disk_state(const DoutPrefixProvider *dpp, librados::IoCtx head_obj_ctx; // initialize to data pool so we can get pool id int ret = get_obj_head_ioctx(dpp, bucket_info, obj->get_obj(), &head_obj_ctx); if (ret < 0) { - ldpp_dout(dpp, 0) << __PRETTY_FUNCTION__ << + ldpp_dout(dpp, 0) << __func__ << " WARNING: unable to find head object data pool for \"" << obj << "\", not updating version pool/epoch" << dendl; } else { -- 2.39.5