summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-09-14 00:45:00 -0700
committerSamuel Just <sam.just@inktank.com>2013-09-19 20:04:19 -0700
commit7f8a7bccdb9a96a82fe24adcf0a89ff63df7f328 (patch)
tree34740340ba1a92b35961bd3367a544ac7257e790
parent4fafa2bf42a6c5e1d4cc08261b8a33d9e254310e (diff)
downloadceph-7f8a7bccdb9a96a82fe24adcf0a89ff63df7f328.tar.gz
OSD,ReplicatedPG: queue pushes in a op_tp workqueue
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/OSD.cc1
-rw-r--r--src/osd/OSD.h1
-rw-r--r--src/osd/ReplicatedPG.cc13
3 files changed, 11 insertions, 4 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index 1756e2e0b1d..bb6f0724688 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -170,6 +170,7 @@ OSDService::OSDService(OSD *osd) :
scrub_wq(osd->scrub_wq),
scrub_finalize_wq(osd->scrub_finalize_wq),
rep_scrub_wq(osd->rep_scrub_wq),
+ push_wq("push_wq", cct->_conf->osd_recovery_thread_timeout, &osd->recovery_tp),
class_handler(osd->class_handler),
publish_lock("OSDService::publish_lock"),
pre_publish_lock("OSDService::pre_publish_lock"),
diff --git a/src/osd/OSD.h b/src/osd/OSD.h
index 17256d61702..f906573e5ad 100644
--- a/src/osd/OSD.h
+++ b/src/osd/OSD.h
@@ -307,6 +307,7 @@ public:
ThreadPool::WorkQueue<PG> &scrub_wq;
ThreadPool::WorkQueue<PG> &scrub_finalize_wq;
ThreadPool::WorkQueue<MOSDRepScrub> &rep_scrub_wq;
+ GenContextWQ push_wq;
ClassHandler *&class_handler;
void dequeue_pg(PG *pg, list<OpRequestRef> *dequeued);
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index dee579ed02a..40838940840 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -1602,14 +1602,14 @@ void ReplicatedBackend::_do_push(OpRequestRef op)
get_parent()->queue_transaction(t);
}
-struct C_ReplicatedBackend_OnPullComplete : Context {
+struct C_ReplicatedBackend_OnPullComplete : GenContext<ThreadPool::TPHandle&> {
ReplicatedBackend *bc;
list<pair<hobject_t, ObjectContextRef> > to_continue;
int priority;
C_ReplicatedBackend_OnPullComplete(ReplicatedBackend *bc, int priority)
: bc(bc), priority(priority) {}
- void finish(int) {
+ void finish(ThreadPool::TPHandle &handle) {
ReplicatedBackend::RPGHandle *h = bc->_open_recovery_op();
for (list<pair<hobject_t, ObjectContextRef> >::iterator i =
to_continue.begin();
@@ -1619,6 +1619,7 @@ struct C_ReplicatedBackend_OnPullComplete : Context {
bc->get_parent()->on_global_recover(
i->first);
}
+ handle.reset_tp_timeout();
}
bc->run_recovery_op(h, priority);
}
@@ -1647,7 +1648,9 @@ void ReplicatedBackend::_do_pull_response(OpRequestRef op)
m->get_priority());
c->to_continue.swap(to_continue);
t->register_on_complete(
- get_parent()->bless_context(c));
+ new QueueInWQ(
+ &osd->push_wq,
+ get_parent()->bless_gencontext(c)));
}
replies.erase(replies.end() - 1);
@@ -6979,7 +6982,9 @@ void ReplicatedBackend::sub_op_push(OpRequestRef op)
op->request->get_priority());
c->to_continue.swap(to_continue);
t->register_on_complete(
- get_parent()->bless_context(c));
+ new QueueInWQ(
+ &osd->push_wq,
+ get_parent()->bless_gencontext(c)));
}
run_recovery_op(h, op->request->get_priority());
} else {