diff options
author | Samuel Just <sam.just@inktank.com> | 2013-08-29 18:16:55 -0700 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-09-26 11:24:25 -0700 |
commit | 3148b12141c8d61d43295bfd7ad3aafc3b3cd484 (patch) | |
tree | 4fb035b98a834f63dd4f426afcf6f3c4facf7b9e /src/osd/ReplicatedPG.cc | |
parent | 30ac934e22e4686b326609371a8c362ebfbfc075 (diff) | |
download | ceph-3148b12141c8d61d43295bfd7ad3aafc3b3cd484.tar.gz |
PG,ReplicatedPG: handle do_request in ReplicatedPG,PGBackend
Signed-off-by: Samuel Just <sam.just@inktank.com>
Diffstat (limited to 'src/osd/ReplicatedPG.cc')
-rw-r--r-- | src/osd/ReplicatedPG.cc | 69 |
1 files changed, 56 insertions, 13 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 787a6082b45..f7bcdd2949b 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -643,6 +643,62 @@ void ReplicatedPG::get_src_oloc(const object_t& oid, const object_locator_t& olo src_oloc.key = oid.name; } +void ReplicatedPG::do_request( + OpRequestRef op, + ThreadPool::TPHandle &handle) +{ + // do any pending flush + do_pending_flush(); + + if (!op_has_sufficient_caps(op)) { + osd->reply_op_error(op, -EPERM); + return; + } + assert(!op_must_wait_for_map(get_osdmap(), op)); + if (can_discard_request(op)) { + return; + } + if (!flushed) { + dout(20) << " !flushed, waiting for active on " << op << dendl; + waiting_for_active.push_back(op); + return; + } + + if (pgbackend->handle_message(op)) + return; + + switch (op->request->get_type()) { + case CEPH_MSG_OSD_OP: + if (is_replay() || !is_active()) { + dout(20) << " replay, waiting for active on " << op << dendl; + waiting_for_active.push_back(op); + return; + } + do_op(op); // do it now + break; + + case MSG_OSD_SUBOP: + do_sub_op(op); + break; + + case MSG_OSD_SUBOPREPLY: + do_sub_op_reply(op); + break; + + case MSG_OSD_PG_SCAN: + do_scan(op, handle); + break; + + case MSG_OSD_PG_BACKFILL: + do_backfill(op); + break; + + default: + assert(0 == "bad message type in do_request"); + } +} + + /** do_op - do an op * pg lock will be held (if multithreaded) * osd_lock NOT held. @@ -1258,11 +1314,6 @@ void ReplicatedPG::do_sub_op(OpRequestRef op) OSDOp *first = NULL; if (m->ops.size() >= 1) { first = &m->ops[0]; - switch (first->op.op) { - case CEPH_OSD_OP_PULL: - sub_op_pull(op); - return; - } } if (!is_active()) { @@ -1273,9 +1324,6 @@ void ReplicatedPG::do_sub_op(OpRequestRef op) if (first) { switch (first->op.op) { - case CEPH_OSD_OP_PUSH: - sub_op_push(op); - return; case CEPH_OSD_OP_DELETE: sub_op_remove(op); return; @@ -1304,11 +1352,6 @@ void ReplicatedPG::do_sub_op_reply(OpRequestRef op) if (r->ops.size() >= 1) { OSDOp& first = r->ops[0]; switch (first.op.op) { - case CEPH_OSD_OP_PUSH: - // continue peer recovery - sub_op_push_reply(op); - return; - case CEPH_OSD_OP_SCRUB_RESERVE: sub_op_scrub_reserve_reply(op); return; |