summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-09-01 14:35:27 -0700
committerSamuel Just <sam.just@inktank.com>2013-09-23 22:54:58 -0700
commit59f1282bf37dc5211659208bda9c4b79068baff4 (patch)
treef6f9aeba54e54160979ba0c88cf9085a6c9cd263
parenta744ebfb2e3f32d9339b35af1153cf50c68be3cc (diff)
downloadceph-59f1282bf37dc5211659208bda9c4b79068baff4.tar.gz
ReplicatedPG/Backend: move over send_pushes/send_pulls/prep_push_op_blank
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedBackend.h10
-rw-r--r--src/osd/ReplicatedPG.cc39
-rw-r--r--src/osd/ReplicatedPG.h10
3 files changed, 27 insertions, 32 deletions
diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h
index fa679a2069c..e056d754f1b 100644
--- a/src/osd/ReplicatedBackend.h
+++ b/src/osd/ReplicatedBackend.h
@@ -230,16 +230,16 @@ private:
bufferlist *data_usable);
void _failed_push(int from, const hobject_t &soid);
- void send_pushes(int prio, map<int, vector<PushOp> > &pushes) {}
- void prep_push_op_blank(const hobject_t& soid, PushOp *op) {}
+ void send_pushes(int prio, map<int, vector<PushOp> > &pushes);
+ void prep_push_op_blank(const hobject_t& soid, PushOp *op);
int send_push_op_legacy(int priority, int peer,
- PushOp &pop) { return 1; }
+ PushOp &pop);
int send_pull_legacy(int priority, int peer,
const ObjectRecoveryInfo& recovery_info,
- ObjectRecoveryProgress progress) { return 1;}
+ ObjectRecoveryProgress progress);
void send_pulls(
int priority,
- map<int, vector<PullOp> > &pulls) {}
+ map<int, vector<PullOp> > &pulls);
int build_push_op(const ObjectRecoveryInfo &recovery_info,
const ObjectRecoveryProgress &progress,
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index af664016a09..2a080238358 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -279,7 +279,8 @@ void ReplicatedPG::wait_for_missing_object(const hobject_t& soid, OpRequestRef o
dout(7) << "missing " << soid << " v " << v << ", pulling." << dendl;
map<int, vector<PullOp> > pulls;
prepare_pull(soid, v, cct->_conf->osd_client_op_priority, &pulls);
- send_pulls(cct->_conf->osd_client_op_priority, pulls);
+ // TODOSAM: replace
+ //send_pulls(g_conf->osd_client_op_priority, pulls);
}
waiting_for_missing_object[soid].push_back(op);
op->mark_delayed("waiting for missing object");
@@ -337,7 +338,8 @@ void ReplicatedPG::wait_for_degraded_object(const hobject_t& soid, OpRequestRef
}
map<int, vector<PushOp> > pushes;
prep_object_replica_pushes(soid, v, cct->_conf->osd_client_op_priority, &pushes);
- send_pushes(cct->_conf->osd_client_op_priority, pushes);
+ // TODOSAM: replace
+ //send_pushes(g_conf->osd_client_op_priority, pushes);
}
waiting_for_degraded_object[soid].push_back(op);
op->mark_delayed("waiting for degraded object");
@@ -6094,9 +6096,9 @@ void ReplicatedPG::prep_push(
pi.recovery_progress = new_progress;
}
-int ReplicatedPG::send_pull_legacy(int prio, int peer,
- const ObjectRecoveryInfo &recovery_info,
- ObjectRecoveryProgress progress)
+int ReplicatedBackend::send_pull_legacy(int prio, int peer,
+ const ObjectRecoveryInfo &recovery_info,
+ ObjectRecoveryProgress progress)
{
// send op
tid_t tid = osd->get_tid();
@@ -6109,7 +6111,7 @@ int ReplicatedPG::send_pull_legacy(int prio, int peer,
<< " from osd." << peer
<< " tid " << tid << dendl;
- MOSDSubOp *subop = new MOSDSubOp(rid, info.pgid, recovery_info.soid,
+ MOSDSubOp *subop = new MOSDSubOp(rid, get_info().pgid, recovery_info.soid,
false, CEPH_OSD_FLAG_ACK,
get_osdmap()->get_epoch(), tid,
recovery_info.version);
@@ -6369,7 +6371,7 @@ void ReplicatedBackend::handle_push(
t);
}
-void ReplicatedPG::send_pushes(int prio, map<int, vector<PushOp> > &pushes)
+void ReplicatedBackend::send_pushes(int prio, map<int, vector<PushOp> > &pushes)
{
for (map<int, vector<PushOp> >::iterator i = pushes.begin();
i != pushes.end();
@@ -6393,7 +6395,7 @@ void ReplicatedPG::send_pushes(int prio, map<int, vector<PushOp> > &pushes)
uint64_t cost = 0;
uint64_t pushes = 0;
MOSDPGPush *msg = new MOSDPGPush();
- msg->pgid = info.pgid;
+ msg->pgid = get_info().pgid;
msg->map_epoch = get_osdmap()->get_epoch();
msg->set_priority(prio);
for (;
@@ -6414,7 +6416,7 @@ void ReplicatedPG::send_pushes(int prio, map<int, vector<PushOp> > &pushes)
}
}
-void ReplicatedPG::send_pulls(int prio, map<int, vector<PullOp> > &pulls)
+void ReplicatedBackend::send_pulls(int prio, map<int, vector<PullOp> > &pulls)
{
for (map<int, vector<PullOp> >::iterator i = pulls.begin();
i != pulls.end();
@@ -6441,7 +6443,7 @@ void ReplicatedPG::send_pulls(int prio, map<int, vector<PullOp> > &pulls)
<< " to osd." << i->first << dendl;
MOSDPGPull *msg = new MOSDPGPull();
msg->set_priority(prio);
- msg->pgid = info.pgid;
+ msg->pgid = get_info().pgid;
msg->map_epoch = get_osdmap()->get_epoch();
msg->pulls.swap(i->second);
msg->compute_cost(cct);
@@ -6558,11 +6560,11 @@ int ReplicatedPG::build_push_op(const ObjectRecoveryInfo &recovery_info,
return 0;
}
-int ReplicatedPG::send_push_op_legacy(int prio, int peer, PushOp &pop)
+int ReplicatedBackend::send_push_op_legacy(int prio, int peer, PushOp &pop)
{
tid_t tid = osd->get_tid();
osd_reqid_t rid(osd->get_cluster_msgr_name(), 0, tid);
- MOSDSubOp *subop = new MOSDSubOp(rid, info.pgid, pop.soid,
+ MOSDSubOp *subop = new MOSDSubOp(rid, get_info().pgid, pop.soid,
false, 0, get_osdmap()->get_epoch(),
tid, pop.recovery_info.version);
subop->ops = vector<OSDOp>(1);
@@ -6583,7 +6585,7 @@ int ReplicatedPG::send_push_op_legacy(int prio, int peer, PushOp &pop)
return 0;
}
-void ReplicatedPG::prep_push_op_blank(const hobject_t& soid, PushOp *op)
+void ReplicatedBackend::prep_push_op_blank(const hobject_t& soid, PushOp *op)
{
op->recovery_info.version = eversion_t();
op->version = eversion_t();
@@ -7693,8 +7695,9 @@ int ReplicatedPG::recover_primary(int max, ThreadPool::TPHandle &handle)
if (!skipped)
pg_log.set_last_requested(v);
}
-
- send_pulls(cct->_conf->osd_recovery_op_priority, pulls);
+
+ // TODOSAM: replace
+ //send_pulls(g_conf->osd_recovery_op_priority, pulls);
return started;
}
@@ -7799,7 +7802,8 @@ int ReplicatedPG::recover_replicas(int max, ThreadPool::TPHandle &handle)
}
}
- send_pushes(cct->_conf->osd_recovery_op_priority, pushes);
+ // TODOSAM: replace
+ //send_pushes(g_conf->osd_recovery_op_priority, pushes);
return started;
}
@@ -7971,7 +7975,8 @@ int ReplicatedPG::recover_backfill(
prep_backfill_object_push(
i->first, i->second.first, i->second.second, backfill_target, &pushes);
}
- send_pushes(cct->_conf->osd_recovery_op_priority, pushes);
+ // TODOSAM: replace
+ //send_pushes(g_conf->osd_recovery_op_priority, pushes);
release_waiting_for_backfill_pos();
dout(5) << "backfill_pos is " << backfill_pos << " and pinfo.last_backfill is "
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index ed94d2f6f44..f0958ca9e3a 100644
--- a/src/osd/ReplicatedPG.h
+++ b/src/osd/ReplicatedPG.h
@@ -545,17 +545,11 @@ protected:
map<hobject_t, PullInfo> pulling;
ObjectRecoveryInfo recalc_subsets(const ObjectRecoveryInfo& recovery_info);
- void send_pushes(int prio, map<int, vector<PushOp> > &pushes);
int build_push_op(const ObjectRecoveryInfo &recovery_info,
const ObjectRecoveryProgress &progress,
ObjectRecoveryProgress *out_progress,
PushOp *out_op);
- int send_push_op_legacy(int priority, int peer,
- PushOp &pop);
- int send_pull_legacy(int priority, int peer,
- const ObjectRecoveryInfo& recovery_info,
- ObjectRecoveryProgress progress);
void submit_push_data(ObjectRecoveryInfo &recovery_info,
bool first,
bool complete,
@@ -662,16 +656,12 @@ protected:
interval_set<uint64_t> &data_subset,
map<hobject_t, interval_set<uint64_t> >& clone_subsets,
PushOp *op);
- void prep_push_op_blank(const hobject_t& soid, PushOp *op);
void finish_degraded_object(const hobject_t& oid);
// Cancels/resets pulls from peer
void check_recovery_sources(const OSDMapRef map);
- void send_pulls(
- int priority,
- map<int, vector<PullOp> > &pulls);
int prepare_pull(
const hobject_t& oid, eversion_t v,
int priority,