osd/scrub: change missing_digest fix-list type

...allowing for efficient creation and, more important,
direct consumption by the function performing the
actual I/O.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
This commit is contained in:
Ronen Friedman 2022-01-13 09:22:11 +00:00
parent d3283fdf2c
commit a007b29859
3 changed files with 10 additions and 14 deletions

View File

@ -42,12 +42,12 @@ bool PrimaryLogScrub::get_store_errors(const scrub_ls_arg_t& arg,
return true;
}
// forwarders used by the scrubber backend
/// \todo combine the multiple transactions into a single one
void PrimaryLogScrub::submit_digest_fixes(const digests_fixes_t& fixes)
{
num_digest_updates_pending += fixes.size();
// note: the following line was modified from '+=' to '=', as we should not
// encounter previous-chunk digest updates after starting a new chunk
num_digest_updates_pending = fixes.size();
dout(10) << __func__
<< ": num_digest_updates_pending: " << num_digest_updates_pending
<< dendl;
@ -99,6 +99,7 @@ void PrimaryLogScrub::submit_digest_fixes(const digests_fixes_t& fixes)
}
}
// a forwarder used by the scrubber backend
void PrimaryLogScrub::add_to_stats(const object_stat_sum_t& stat)
{

View File

@ -968,7 +968,8 @@ void ScrubBackend::inconsistents(const hobject_t& ho,
if (auth_object.omap_digest_present) {
omap_digest = auth_object.omap_digest;
}
this_chunk->missing_digest[ho] = make_pair(data_digest, omap_digest);
this_chunk->missing_digest.push_back(
make_pair(ho, make_pair(data_digest, omap_digest)));
}
if (!this_chunk->cur_inconsistent.empty() ||
@ -1017,7 +1018,8 @@ void ScrubBackend::inconsistents(const hobject_t& ho,
dout(20) << __func__ << ": will update omap digest on " << ho
<< dendl;
}
this_chunk->missing_digest[ho] = make_pair(data_digest, omap_digest);
this_chunk->missing_digest.push_back(
make_pair(ho, make_pair(data_digest, omap_digest)));
break;
}
}
@ -1739,14 +1741,7 @@ void ScrubBackend::scrub_snapshot_metadata(ScrubMap& map)
m_scrubber.m_store->add_snap_error(pool.id, head_error);
// fix data/omap digests
digests_fixes_t digest_fixes{this_chunk->missing_digest.size()};
std::transform(
this_chunk->missing_digest.begin(),
this_chunk->missing_digest.end(),
digest_fixes.begin(),
[](const auto& p) { return std::make_pair(p.first, p.second); });
m_scrubber.submit_digest_fixes(digest_fixes);
m_scrubber.submit_digest_fixes(this_chunk->missing_digest);
dout(10) << __func__ << " (" << m_mode_desc << ") finish" << dendl;
}

View File

@ -171,7 +171,7 @@ struct scrub_chunk_t {
utime_t started{ceph_clock_now()};
std::map<hobject_t, data_omap_digests_t> missing_digest;
digests_fixes_t missing_digest;
/// Map from object with errors to good peers
std::map<hobject_t, std::list<pg_shard_t>> authoritative;