summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-09-01 14:01:21 -0700
committerSamuel Just <sam.just@inktank.com>2013-09-26 11:24:26 -0700
commitf9810797afda85525fe7d683f6f483881529db81 (patch)
tree0f042bcf1977f65cc657b3cd0bcfccc4fce0905f
parent666a316d5a8973fbaa2dddbc722c565b9ab83fff (diff)
downloadceph-f9810797afda85525fe7d683f6f483881529db81.tar.gz
ReplicatedPG/Backend: move handle_*
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedBackend.h10
-rw-r--r--src/osd/ReplicatedPG.cc34
-rw-r--r--src/osd/ReplicatedPG.h13
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> &copy_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 5560813af8e..dd2755debee 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -6229,7 +6229,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)
{
@@ -6263,7 +6263,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;
@@ -6275,7 +6276,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;
@@ -6312,13 +6314,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;
@@ -6338,7 +6343,7 @@ struct C_OnPushCommit : public Context {
}
};
-void ReplicatedPG::handle_push(
+void ReplicatedBackend::handle_push(
int from, PushOp &pop, PushReplyOp *response,
ObjectStore::Transaction *t)
{
@@ -6364,7 +6369,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,
@@ -6611,7 +6616,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) {
@@ -6638,14 +6643,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;
@@ -6713,13 +6718,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 {
@@ -6836,7 +6842,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> &copy_subset,
const interval_set<uint64_t> &intervals_received,
bufferlist data_received,
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index cc3f9f57134..fcbb2d58dc4 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> &copy_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;