summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-01-21 14:14:25 -0800
committerSage Weil <sage@inktank.com>2013-01-22 14:47:40 -0800
commitb685f727d4c37a26cb78bd4a04cce041428ceb52 (patch)
treec7e52eee42d5e2fcb99a7f9b0e7ae755d2d16def
parenta1bf8220e545f29b83d965f07b1abfbea06238b3 (diff)
downloadceph-b685f727d4c37a26cb78bd4a04cce041428ceb52.tar.gz
osd: add OpRequest flag point when commit is sent
With writeahead journaling in particular, we can get requests that stay in the queue for a long time even after the commit is sent to the client while we are waiting for the transaction to apply to the fs. Instead of showing up as 'waiting for subops', make it clear that the client has gotten its reply and it is local state that is slow. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/osd/OpRequest.h9
-rw-r--r--src/osd/ReplicatedPG.cc1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h
index 0b35fd89f70..93277789ddf 100644
--- a/src/osd/OpRequest.h
+++ b/src/osd/OpRequest.h
@@ -139,6 +139,7 @@ private:
static const uint8_t flag_delayed = 1 << 2;
static const uint8_t flag_started = 1 << 3;
static const uint8_t flag_sub_op_sent = 1 << 4;
+ static const uint8_t flag_commit_sent = 1 << 5;
OpRequest(Message *req, OpTracker *tracker) :
request(req), xitem(this),
@@ -162,11 +163,13 @@ public:
bool been_delayed() { return hit_flag_points & flag_delayed; }
bool been_started() { return hit_flag_points & flag_started; }
bool been_sub_op_sent() { return hit_flag_points & flag_sub_op_sent; }
+ bool been_commit_sent() { return hit_flag_points & flag_commit_sent; }
bool currently_queued_for_pg() { return latest_flag_point & flag_queued_for_pg; }
bool currently_reached_pg() { return latest_flag_point & flag_reached_pg; }
bool currently_delayed() { return latest_flag_point & flag_delayed; }
bool currently_started() { return latest_flag_point & flag_started; }
bool currently_sub_op_sent() { return latest_flag_point & flag_sub_op_sent; }
+ bool currently_commit_sent() { return latest_flag_point & flag_commit_sent; }
const char *state_string() const {
switch(latest_flag_point) {
@@ -175,6 +178,7 @@ public:
case flag_delayed: return "delayed";
case flag_started: return "started";
case flag_sub_op_sent: return "waiting for sub ops";
+ case flag_commit_sent: return "commit sent; apply or cleanup";
default: break;
}
return "no flag points reached";
@@ -204,6 +208,11 @@ public:
hit_flag_points |= flag_sub_op_sent;
latest_flag_point = flag_sub_op_sent;
}
+ void mark_commit_sent() {
+ mark_event("commit_sent");
+ hit_flag_points |= flag_commit_sent;
+ latest_flag_point = flag_commit_sent;
+ }
void mark_event(const string &event);
osd_reqid_t get_reqid() const {
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index 2e15e945b10..1738d29edb9 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -3876,6 +3876,7 @@ void ReplicatedPG::eval_repop(RepGather *repop)
assert(entity_name_t::TYPE_OSD != m->get_connection()->peer_type);
osd->send_message_osd_client(reply, m->get_connection());
repop->sent_disk = true;
+ repop->ctx->op->mark_commit_sent();
}
}