void do_pull(OpRequestRef op);
void do_push_reply(OpRequestRef op);
- bool handle_push_reply(int peer, PushReplyOp &op, PushOp *reply) { return true; }
- void handle_pull(int peer, PullOp &op, PushOp *reply) {}
+ bool handle_push_reply(int peer, PushReplyOp &op, PushOp *reply);
+ void handle_pull(int peer, PullOp &op, PushOp *reply);
bool handle_pull_response(int from, PushOp &op, PullOp *response,
- ObjectStore::Transaction *t) { return true; }
+ ObjectStore::Transaction *t);
void handle_push(int from, PushOp &op, PushReplyOp *response,
- ObjectStore::Transaction *t) {}
+ ObjectStore::Transaction *t);
static void trim_pushed_data(const interval_set<uint64_t> ©_subset,
const interval_set<uint64_t> &intervals_received,
bufferlist data_received,
interval_set<uint64_t> *intervals_usable,
- bufferlist *data_usable) {}
+ bufferlist *data_usable);
void _failed_push(int from, const hobject_t &soid) {}
void send_pushes(int prio, map<int, vector<PushOp> > &pushes) {}
return new_info;
}
-bool ReplicatedPG::handle_pull_response(
+bool ReplicatedBackend::handle_pull_response(
int from, PushOp &pop, PullOp *response,
ObjectStore::Transaction *t)
{
pop.recovery_info.copy_subset);
}
- pi.recovery_info = recalc_subsets(pi.recovery_info);
+ // TODOSAM: probably just kill this
+ //pi.recovery_info = recalc_subsets(pi.recovery_info);
interval_set<uint64_t> usable_intervals;
bufferlist usable_data;
data_included = usable_intervals;
data.claim(usable_data);
- info.stats.stats.sum.num_bytes_recovered += data.length();
+ // TODOSAM: add into the stats passed into on_local_recover
+ //info.stats.stats.sum.num_bytes_recovered += data.length();
bool first = pi.recovery_progress.first;
pi.recovery_progress = pop.after_progress;
pop.omap_entries,
t);
- info.stats.stats.sum.num_keys_recovered += pop.omap_entries.size();
+ // TODOSAM: add into the stats passed into on_local_recover
+ //info.stats.stats.sum.num_keys_recovered += pop.omap_entries.size();
if (complete) {
pulling.erase(hoid);
pull_from_peer[from].erase(hoid);
- info.stats.stats.sum.num_objects_recovered++;
- on_local_recover(hoid, object_stat_sum_t(), pi.recovery_info, pi.obc, t);
+ // TODOSAM: add into the stats passed into on_local_recover
+ //info.stats.stats.sum.num_objects_recovered++;
+ get_parent()->on_local_recover(
+ hoid, object_stat_sum_t(), pi.recovery_info, pi.obc, t);
return false;
} else {
response->soid = pop.soid;
}
};
-void ReplicatedPG::handle_push(
+void ReplicatedBackend::handle_push(
int from, PushOp &pop, PushReplyOp *response,
ObjectStore::Transaction *t)
{
t);
if (complete)
- on_local_recover(
+ get_parent()->on_local_recover(
pop.recovery_info.soid,
object_stat_sum_t(),
pop.recovery_info,
send_push_op_legacy(pushing[soid][peer].priority, peer, pop);
}
-bool ReplicatedPG::handle_push_reply(int peer, PushReplyOp &op, PushOp *reply)
+bool ReplicatedBackend::handle_push_reply(int peer, PushReplyOp &op, PushOp *reply)
{
const hobject_t &soid = op.soid;
if (pushing.count(soid) == 0) {
return true;
} else {
// done!
- on_peer_recover(peer, soid, pi->recovery_info);
+ get_parent()->on_peer_recover(peer, soid, pi->recovery_info);
pushing[soid].erase(peer);
pi = NULL;
if (pushing[soid].empty()) {
- on_global_recover(soid);
+ get_parent()->on_global_recover(soid);
} else {
dout(10) << "pushed " << soid << ", still waiting for push ack from "
<< pushing[soid].size() << " others" << dendl;
log_subop_stats(osd, op, 0, l_osd_sop_pull_lat);
}
-void ReplicatedPG::handle_pull(int peer, PullOp &op, PushOp *reply)
+void ReplicatedBackend::handle_pull(int peer, PullOp &op, PushOp *reply)
{
const hobject_t &soid = op.soid;
struct stat st;
int r = osd->store->stat(coll, soid, &st);
if (r != 0) {
- osd->clog.error() << info.pgid << " " << peer << " tried to pull " << soid
+ osd->clog.error() << get_info().pgid << " "
+ << peer << " tried to pull " << soid
<< " but got " << cpp_strerror(-r) << "\n";
prep_push_op_blank(soid, reply);
} else {
* @param intervals_usable intervals we want to keep
* @param data_usable matching data we want to keep
*/
-void ReplicatedPG::trim_pushed_data(
+void ReplicatedBackend::trim_pushed_data(
const interval_set<uint64_t> ©_subset,
const interval_set<uint64_t> &intervals_received,
bufferlist data_received,
map<hobject_t, PullInfo> pulling;
ObjectRecoveryInfo recalc_subsets(const ObjectRecoveryInfo& recovery_info);
- static void trim_pushed_data(const interval_set<uint64_t> ©_subset,
- const interval_set<uint64_t> &intervals_received,
- bufferlist data_received,
- interval_set<uint64_t> *intervals_usable,
- bufferlist *data_usable);
- bool handle_pull_response(
- int from, PushOp &op, PullOp *response,
- ObjectStore::Transaction *t);
- void handle_push(
- int from, PushOp &op, PushReplyOp *response,
- ObjectStore::Transaction *t);
void send_pushes(int prio, map<int, vector<PushOp> > &pushes);
int build_push_op(const ObjectRecoveryInfo &recovery_info,
const ObjectRecoveryProgress &progress,
void _committed_pushed_object(epoch_t epoch, eversion_t lc);
void recover_got(hobject_t oid, eversion_t v);
void _failed_push(int from, const hobject_t &soid);
- bool handle_push_reply(int peer, PushReplyOp &op, PushOp *reply);
- void handle_pull(int peer, PullOp &op, PushOp *reply);
// -- copyfrom --
map<hobject_t, CopyOpRef> copy_ops;