summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-02-07 23:13:11 -0800
committerSage Weil <sage@inktank.com>2013-02-12 14:15:32 -0800
commit0453140d187016a61950a8836da57f54d2c34602 (patch)
treecb845fa461acc60240e40e0c4321f47ea7e7fb9e
parente68fcec78286363935cf731015108b9ea36b50a6 (diff)
downloadceph-0453140d187016a61950a8836da57f54d2c34602.tar.gz
mon: retry PGStats message on EAGAIN
If we get EAGAIN from a paxos restart/election/whatever, we should restart the message instead of just blindly acking it. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Joao Luis <joao.luis@inktank.com> (cherry picked from commit 4837063d447afb45554f55bb6fde1c97559acd4b)
-rw-r--r--src/mon/PGMonitor.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mon/PGMonitor.h b/src/mon/PGMonitor.h
index 2927c00453a..5db1744111d 100644
--- a/src/mon/PGMonitor.h
+++ b/src/mon/PGMonitor.h
@@ -71,12 +71,15 @@ private:
entity_inst_t who;
C_Stats(PGMonitor *p, MPGStats *r, MPGStatsAck *a) : pgmon(p), req(r), ack(a) {}
void finish(int r) {
- if (r == -ECANCELED) {
+ if (r >= 0) {
+ pgmon->_updated_stats(req, ack);
+ } else if (r == -ECANCELED) {
req->put();
ack->put();
- return;
+ } else {
+ ack->put();
+ dispatch(req);
}
- pgmon->_updated_stats(req, ack);
}
};