summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-09-09 16:08:30 -0700
committerSamuel Just <sam.just@inktank.com>2013-09-23 22:54:59 -0700
commit914770f0c40091eb3025280ecd8b3707275dd698 (patch)
treef82640a194f9c7ecf6f69554ed29b130e14a6889
parentebdac94f98747b881a36312d93295380db456d76 (diff)
downloadceph-914770f0c40091eb3025280ecd8b3707275dd698.tar.gz
ReplicatedPG: correctly handle backfill
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedBackend.cc1
-rw-r--r--src/osd/ReplicatedPG.cc33
-rw-r--r--src/osd/ReplicatedPG.h2
3 files changed, 18 insertions, 18 deletions
diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc
index 59ce9bbcceb..9868e7af2c8 100644
--- a/src/osd/ReplicatedBackend.cc
+++ b/src/osd/ReplicatedBackend.cc
@@ -61,7 +61,6 @@ void ReplicatedBackend::recover_object(
return;
} else {
assert(obc);
- assert(head);
int started = start_pushes(
hoid,
obc,
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index be6cd1feceb..dcf3efd7766 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -222,10 +222,9 @@ void ReplicatedPG::on_peer_recover(
info.stats.stats.sum.add(stat);
publish_stats_to_osd();
// done!
+ peer_missing[peer].got(soid, recovery_info.version);
if (peer == backfill_target && backfills_in_flight.count(soid))
backfills_in_flight.erase(soid);
- else
- peer_missing[peer].got(soid, recovery_info.version);
}
void ReplicatedPG::begin_peer_recover(
@@ -8044,16 +8043,16 @@ int ReplicatedPG::recover_backfill(
send_remove_op(i->first, i->second, backfill_target);
}
+ PGBackend::RecoveryHandle *h = pgbackend->open_recovery_op();
map<int, vector<PushOp> > pushes;
for (map<hobject_t, pair<eversion_t, eversion_t> >::iterator i = to_push.begin();
i != to_push.end();
++i) {
handle.reset_tp_timeout();
prep_backfill_object_push(
- i->first, i->second.first, i->second.second, backfill_target, &pushes);
+ i->first, i->second.first, i->second.second, backfill_target, h);
}
- // TODOSAM: replace
- //send_pushes(g_conf->osd_recovery_op_priority, pushes);
+ pgbackend->run_recovery_op(h, cct->_conf->osd_recovery_op_priority);
release_waiting_for_backfill_pos();
dout(5) << "backfill_pos is " << backfill_pos << " and pinfo.last_backfill is "
@@ -8099,23 +8098,25 @@ int ReplicatedPG::recover_backfill(
void ReplicatedPG::prep_backfill_object_push(
hobject_t oid, eversion_t v, eversion_t have, int peer,
- map<int, vector<PushOp> > *pushes)
+ PGBackend::RecoveryHandle *h)
{
dout(10) << "push_backfill_object " << oid << " v " << v << " to osd." << peer << dendl;
backfills_in_flight.insert(oid);
+ map<int, pg_missing_t>::iterator bpm = peer_missing.find(backfill_target);
+ assert(bpm != peer_missing.end());
+ bpm->second.add(oid, eversion_t(), eversion_t());
+
+ assert(!recovering.count(oid));
- if (!recovering.count(oid))
- start_recovery_op(oid);
+ start_recovery_op(oid);
+ recovering.insert(oid);
ObjectContextRef obc = get_object_context(oid, false);
-// TODOSAM: fix
-#if 0
- obc->ondisk_read_lock();
- (*pushes)[peer].push_back(PushOp());
- prep_push_to_replica(obc, oid, peer, cct->_conf->osd_recovery_op_priority,
- &((*pushes)[peer].back()));
- obc->ondisk_read_unlock();
-#endif
+ pgbackend->recover_object(
+ oid,
+ ObjectContextRef(),
+ obc,
+ h);
}
void ReplicatedPG::scan_range(
diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h
index 8c5b4f9f046..3d0cf19410d 100644
--- a/src/osd/ReplicatedPG.h
+++ b/src/osd/ReplicatedPG.h
@@ -629,7 +629,7 @@ protected:
void prep_backfill_object_push(
hobject_t oid, eversion_t v, eversion_t have, int peer,
- map<int, vector<PushOp> > *pushes);
+ PGBackend::RecoveryHandle *h);
void send_remove_op(const hobject_t& oid, eversion_t v, int peer);