From: Kefu Chai Date: Tue, 2 Jan 2018 16:00:45 +0000 (+0800) Subject: Merge pull request #19546 from ZVampirEM77/wip-em-pg-cleanup3 X-Git-Tag: v13.0.2~676 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d0a5dc5a7dbdebd4733068bd2af129d7a94a0da;p=ceph.git Merge pull request #19546 from ZVampirEM77/wip-em-pg-cleanup3 osd/PG: some cleanups && add should_gather filter for loop logging Reviewed-by: Sage Weil Reviewed-by: Kefu Chai --- 2d0a5dc5a7dbdebd4733068bd2af129d7a94a0da diff --cc src/osd/PG.cc index 5b6bb10d0354,2d2dddf72d7d..9ff134169e00 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@@ -1237,18 -1237,20 +1237,19 @@@ void PG::calc_replicated_acting set *acting_backfill, ostream &ss) { - ss << "calc_acting newest update on osd." << auth_log_shard->first + pg_shard_t auth_log_shard_id = auth_log_shard->first; + + ss << __func__ << " newest update on osd." << auth_log_shard_id << " with " << auth_log_shard->second << (restrict_to_up_acting ? " restrict_to_up_acting" : "") << std::endl; - pg_shard_t auth_log_shard_id = auth_log_shard->first; // select primary - map::const_iterator primary; + map::const_iterator primary = all_info.find(up_primary); if (up.size() && - !all_info.find(up_primary)->second.is_incomplete() && - all_info.find(up_primary)->second.last_update >= + !primary->second.is_incomplete() && + primary->second.last_update >= auth_log_shard->second.log_tail) { ss << "up_primary: " << up_primary << ") selected as primary" << std::endl; - primary = all_info.find(up_primary); // prefer up[0], all thing being equal } else { assert(!auth_log_shard->second.is_incomplete()); ss << "up[0] needs backfill, osd." << auth_log_shard_id