diff options
author | Samuel Just <sam.just@inktank.com> | 2013-09-01 14:01:21 -0700 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-09-19 12:50:45 -0700 |
commit | a03711018e2b0170639bd8f6045122a1ba10afb3 (patch) | |
tree | 78be08717f41321f84abc00cc3efb842e41a4be3 | |
parent | 74634edb5eabf4d5c2fa59c975d0fc2a51983d86 (diff) | |
download | ceph-a03711018e2b0170639bd8f6045122a1ba10afb3.tar.gz |
ReplicatedPG/Backend: move handle_*
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r-- | src/osd/ReplicatedBackend.h | 10 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.cc | 34 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.h | 13 |
3 files changed, 25 insertions, 32 deletions
diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index bba797e5ae5..e705bb9108c 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -216,18 +216,18 @@ private: 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) {} diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 9ff71a572df..7aaad536c7f 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6216,7 +6216,7 @@ ObjectRecoveryInfo ReplicatedPG::recalc_subsets(const ObjectRecoveryInfo& recove return new_info; } -bool ReplicatedPG::handle_pull_response( +bool ReplicatedBackend::handle_pull_response( int from, PushOp &pop, PullOp *response, ObjectStore::Transaction *t) { @@ -6250,7 +6250,8 @@ bool ReplicatedPG::handle_pull_response( 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; @@ -6262,7 +6263,8 @@ bool ReplicatedPG::handle_pull_response( 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; @@ -6299,13 +6301,16 @@ bool ReplicatedPG::handle_pull_response( 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; @@ -6325,7 +6330,7 @@ struct C_OnPushCommit : public Context { } }; -void ReplicatedPG::handle_push( +void ReplicatedBackend::handle_push( int from, PushOp &pop, PushReplyOp *response, ObjectStore::Transaction *t) { @@ -6351,7 +6356,7 @@ void ReplicatedPG::handle_push( t); if (complete) - on_local_recover( + get_parent()->on_local_recover( pop.recovery_info.soid, object_stat_sum_t(), pop.recovery_info, @@ -6598,7 +6603,7 @@ void ReplicatedBackend::sub_op_push_reply(OpRequestRef op) 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) { @@ -6625,14 +6630,14 @@ bool ReplicatedPG::handle_push_reply(int peer, PushReplyOp &op, PushOp *reply) 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; @@ -6700,13 +6705,14 @@ void ReplicatedBackend::sub_op_pull(OpRequestRef op) 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 { @@ -6823,7 +6829,7 @@ void ReplicatedPG::recover_got(hobject_t oid, eversion_t v) * @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, diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 05d9845292e..a92f6c95c54 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -545,17 +545,6 @@ protected: 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, @@ -851,8 +840,6 @@ protected: 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; |