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-14 00:45:32 -0700 |
commit | bf259aab24429c7a1634e630592166fb4f6b851c (patch) | |
tree | e999778b199dc22cbce4efe12a61c358c0ad95d1 | |
parent | b0511134e8ef40aec61f19bab9d771d85ece6f30 (diff) | |
download | ceph-bf259aab24429c7a1634e630592166fb4f6b851c.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 beeb7dc6636..3a98f50b4f2 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -208,18 +208,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 7dbcea234dc..6e75cdc4295 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6095,7 +6095,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) { @@ -6129,7 +6129,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; @@ -6141,7 +6142,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; @@ -6178,13 +6180,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; @@ -6204,7 +6209,7 @@ struct C_OnPushCommit : public Context { } }; -void ReplicatedPG::handle_push( +void ReplicatedBackend::handle_push( int from, PushOp &pop, PushReplyOp *response, ObjectStore::Transaction *t) { @@ -6230,7 +6235,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, @@ -6477,7 +6482,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) { @@ -6504,14 +6509,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; @@ -6579,13 +6584,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 { @@ -6702,7 +6708,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 9b0d1d61f8d..5c2c4fdf46b 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -543,17 +543,6 @@ protected: set<hobject_t> temp_contents; 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, @@ -846,8 +835,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; |