*v = i->second.need;
return true;
}
+ bool is_deleted(const hobject_t &hoid) const {
+ auto i = needs_recovery_map.find(hoid);
+ if (i == needs_recovery_map.end())
+ return false;
+ return i->second.is_delete();
+ }
bool is_unfound(const hobject_t &hoid) const {
- return needs_recovery(hoid) && (
+ return needs_recovery(hoid) && !is_deleted(hoid) && (
!missing_loc.count(hoid) ||
!(*is_recoverable)(missing_loc.find(hoid)->second));
}
if (j == needs_recovery_map.end()) {
needs_recovery_map.insert(*i);
} else {
+ lgeneric_dout(pg->cct, 0) << this << " " << pg->info.pgid << " unexpected need for "
+ << i->first << " have " << j->second
+ << " tried to add " << i->second << dendl;
assert(i->second.need == j->second.need);
}
}
return; // recovered!
needs_recovery_map[hoid] = *item;
+ if (item->is_delete())
+ return;
auto mliter =
missing_loc.insert(make_pair(hoid, set<pg_shard_t>())).first;
assert(info.last_backfill.is_max());
bool needs_recovery() const;
bool needs_backfill() const;
+ /// clip calculated priority to reasonable range
+ inline int clamp_recovery_priority(int priority);
/// get log recovery reservation priority
unsigned get_recovery_priority();
/// get backfill reservation priority
unsigned get_backfill_priority();
void mark_clean(); ///< mark an active pg clean
+ void change_recovery_force_mode(int new_mode, bool clear);
/// return [start,end) bounds for required past_intervals
static pair<epoch_t, epoch_t> get_required_past_interval_bounds(
struct NotRecovering : boost::statechart::state< NotRecovering, Active>, NamedState {
typedef boost::mpl::list<
- boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >
+ boost::statechart::transition< DoRecovery, WaitLocalRecoveryReserved >,
+ boost::statechart::custom_reaction< CancelRecovery >
> reactions;
explicit NotRecovering(my_context ctx);
+ boost::statechart::result react(const CancelRecovery& evt) {
+ /* no-op */
+ return discard_event();
+ }
void exit();
};
uint64_t get_min_acting_features() const { return acting_features; }
uint64_t get_min_upacting_features() const { return upacting_features; }
+ bool perform_deletes_during_peering() const {
+ return !(get_osdmap()->test_flag(CEPH_OSDMAP_RECOVERY_DELETES));
+ }
void init_primary_up_acting(
const vector<int> &newup,
virtual void kick_snap_trim() = 0;
virtual void snap_trimmer_scrub_complete() = 0;
bool requeue_scrub(bool high_priority = false);
- void queue_recovery(bool front = false);
+ void queue_recovery();
bool queue_scrub();
unsigned get_scrub_priority();