From: Greg Farnum Date: Fri, 29 Jan 2010 21:05:44 +0000 (-0800) Subject: mon: possible fix for rare problem where osd boot messages are double-logged. X-Git-Tag: v0.19~135 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a96af2ecc7fbd725eff03cd7ac7f7b15c72632c2;p=ceph.git mon: possible fix for rare problem where osd boot messages are double-logged. From Sage. --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index a7f1c169f9b0..f62b98bcdb2d 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -433,6 +433,10 @@ bool OSDMonitor::prepare_boot(MOSDBoot *m) pending_inc.new_down[from] = false; paxos->wait_for_commit(new C_RetryMessage(this, m)); + } else if (pending_inc.new_up.count(from)) { + // already prepared, just wait + dout(7) << "prepare_boot already prepared, waiting on " << m->get_orig_source_addr() << dendl; + paxos->wait_for_commit(new C_Booted(this, m, false)); } else { // mark new guy up. down_pending_out.erase(from); // if any diff --git a/src/mon/OSDMonitor.h b/src/mon/OSDMonitor.h index 3632035e9702..1c5f50414f17 100644 --- a/src/mon/OSDMonitor.h +++ b/src/mon/OSDMonitor.h @@ -93,11 +93,12 @@ private: struct C_Booted : public Context { OSDMonitor *cmon; MOSDBoot *m; - C_Booted(OSDMonitor *cm, MOSDBoot *m_) : - cmon(cm), m(m_) {} + bool logit; + C_Booted(OSDMonitor *cm, MOSDBoot *m_, bool l=true) : + cmon(cm), m(m_), logit(l) {} void finish(int r) { if (r >= 0) - cmon->_booted(m, true); + cmon->_booted(m, logit); else cmon->dispatch((PaxosServiceMessage*)m); }