peer_missing[from].claim(std::move(omissing));
}
+/**
+* Update min_last_complete_ondisk to the minimum
+* last_complete_ondisk version informed by each peer.
+*/
+void PeeringState::calc_min_last_complete_ondisk() {
+ ceph_assert(!acting_recovery_backfill.empty());
+ eversion_t min = last_complete_ondisk;
+ for (const auto& pg_shard : acting_recovery_backfill) {
+ if (pg_shard == get_primary()) {
+ continue;
+ }
+ if (peer_last_complete_ondisk.count(pg_shard) == 0) {
+ psdout(20) << __func__ << " no complete info on: "
+ << pg_shard << dendl;
+ return;
+ }
+ if (peer_last_complete_ondisk[pg_shard] < min) {
+ min = peer_last_complete_ondisk[pg_shard];
+ }
+ }
+ if (min != min_last_complete_ondisk) {
+ psdout(20) << __func__ << " last_complete_ondisk is "
+ << "updated to: " << min
+ << " from: " << min_last_complete_ondisk
+ << dendl;
+ min_last_complete_ondisk = min;
+ }
+}
+
void PeeringState::fulfill_info(
pg_shard_t from, const pg_query_t &query,
pair<pg_shard_t, pg_info_t> ¬ify_info)
void proc_replica_log(pg_info_t &oinfo, const pg_log_t &olog,
pg_missing_t&& omissing, pg_shard_t from);
- void calc_min_last_complete_ondisk() {
- eversion_t min = last_complete_ondisk;
- ceph_assert(!acting_recovery_backfill.empty());
- for (std::set<pg_shard_t>::iterator i = acting_recovery_backfill.begin();
- i != acting_recovery_backfill.end();
- ++i) {
- if (*i == get_primary()) continue;
- if (peer_last_complete_ondisk.count(*i) == 0)
- return; // we don't have complete info
- eversion_t a = peer_last_complete_ondisk[*i];
- if (a < min)
- min = a;
- }
- if (min == min_last_complete_ondisk)
- return;
- min_last_complete_ondisk = min;
- return;
- }
+ void calc_min_last_complete_ondisk();
void fulfill_info(
pg_shard_t from, const pg_query_t &query,