From: Samuel Just Date: Fri, 14 Jun 2013 22:35:55 +0000 (-0700) Subject: ReplicatedPG: split handle_push_reply out of sub_op_push_reply X-Git-Tag: v0.67-rc1~138^2~1^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=175c0777ed9ab96800c5a26f996872fdae6dd901;p=ceph.git ReplicatedPG: split handle_push_reply out of sub_op_push_reply Signed-off-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index fa5fa36ffecf..7917bdcc59b7 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -5902,21 +5902,33 @@ void ReplicatedPG::send_push_op_blank(const hobject_t& soid, int peer) void ReplicatedPG::sub_op_push_reply(OpRequestRef op) { MOSDSubOpReply *reply = static_cast(op->request); + const hobject_t& soid = reply->get_poid(); assert(reply->get_header().type == MSG_OSD_SUBOPREPLY); dout(10) << "sub_op_push_reply from " << reply->get_source() << " " << *reply << dendl; + int peer = reply->get_source().num(); op->mark_started(); - int peer = reply->get_source().num(); - const hobject_t& soid = reply->get_poid(); - + PushReplyOp rop; + rop.soid = soid; + PushOp pop; + bool more = handle_push_reply(peer, rop, &pop); + if (more) + send_push_op(pushing[soid][peer].priority, peer, pop); +} + +bool ReplicatedPG::handle_push_reply(int peer, PushReplyOp &op, PushOp *reply) +{ + const hobject_t &soid = op.soid; if (pushing.count(soid) == 0) { dout(10) << "huh, i wasn't pushing " << soid << " to osd." << peer << ", or anybody else" << dendl; + return false; } else if (pushing[soid].count(peer) == 0) { dout(10) << "huh, i wasn't pushing " << soid << " to osd." << peer << dendl; + return false; } else { PushInfo *pi = &pushing[soid][peer]; @@ -5925,11 +5937,11 @@ void ReplicatedPG::sub_op_push_reply(OpRequestRef op) << pi->recovery_progress.data_recovered_to << " of " << pi->recovery_info.copy_subset << dendl; ObjectRecoveryProgress new_progress; - send_push( - pi->priority, - peer, pi->recovery_info, - pi->recovery_progress, &new_progress); + build_push_op( + pi->recovery_info, + pi->recovery_progress, &new_progress, reply); pi->recovery_progress = new_progress; + return true; } else { // done! if (peer == backfill_target && backfills_in_flight.count(soid)) @@ -5955,6 +5967,7 @@ void ReplicatedPG::sub_op_push_reply(OpRequestRef op) dout(10) << "pushed " << soid << ", still waiting for push ack from " << pushing[soid].size() << " others" << dendl; } + return false; } } } diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index dd2ba7f31136..25a1ef0e40f1 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -897,6 +897,7 @@ protected: void sub_op_push(OpRequestRef op); void _failed_push(int from, const hobject_t &soid); void sub_op_push_reply(OpRequestRef op); + bool handle_push_reply(int peer, PushReplyOp &op, PushOp *reply); void sub_op_pull(OpRequestRef op); void log_subop_stats(OpRequestRef op, int tag_inb, int tag_lat);