void clear_recovery_state();
virtual void _clear_recovery_state() = 0;
void defer_recovery();
+ virtual void check_recovery_op_pulls(const OSDMap &newmap) = 0;
void start_recovery_op(const sobject_t& soid);
void finish_recovery_op(const sobject_t& soid, bool dequeue=false);
// take note
assert(pulling.count(soid) == 0);
+ rec_from_peer[fromosd].insert(soid);
pull_info_t& p = pulling[soid];
p.version = v;
p.from = fromosd;
if (complete) {
// close out pull op
pulling.erase(soid);
+ rec_from_peer[pi->from].erase(soid);
finish_recovery_op(soid);
update_stats();
}
finish_recovery_op(soid); // close out this attempt,
+ rec_from_peer[from].erase(soid);
pulling.erase(soid);
op->put();
// clear pushing/pulling maps
pushing.clear();
pulling.clear();
+ rec_from_peer.clear();
}
void ReplicatedPG::on_role_change()
#endif
pulling.clear();
pushing.clear();
+ rec_from_peer.clear();
}
+void ReplicatedPG::check_recovery_op_pulls(const OSDMap &osdmap)
+{
+ map<int, set<sobject_t> >::iterator j = rec_from_peer.begin();
+ for (;
+ j != rec_from_peer.end();
+ ) {
+ if (osdmap.is_up(j->first)) {
+ ++j;
+ continue;
+ }
+ dout(10) << "Reseting pulls from osd" << j->first
+ << ", osdmap has it marked down" << dendl;
+
+ for (set<sobject_t>::iterator i = j->second.begin();
+ i != j->second.end();
+ ++i) {
+ assert(pulling.count(*i) == 1);
+ pulling.erase(*i);
+ finish_recovery_op(*i);
+ }
+ log.last_requested = eversion_t();
+ rec_from_peer.erase(j++);
+ }
+}
+
int ReplicatedPG::start_recovery_ops(int max)
{
};
map<sobject_t, pull_info_t> pulling;
+ // Reverse mapping from osd peer to objects beging pulled from that peer
+ map<int, set<sobject_t> > rec_from_peer;
+
// push
struct push_info_t {
uint64_t size;
map<sobject_t, interval_set<uint64_t> >& clone_subsets);
void send_push_op_blank(const sobject_t& soid, int peer);
+ // Cancels/resets pulls from peer
+ void check_recovery_op_pulls(const OSDMap &map);
int pull(const sobject_t& oid);
void send_pull_op(const sobject_t& soid, eversion_t v, bool first, const interval_set<uint64_t>& data_subset, int fromosd);