mon: possible fix for rare problem where osd boot messages are double-logged.

From Sage.
This commit is contained in:
Greg Farnum 2010-01-29 13:05:44 -08:00
parent 883c6faaff
commit a96af2ecc7
2 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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);
}