mon: Elector: clean ack set on election start

We should never consider old 'acks' from monitors on a new election. We
usually do it, but we didn't if an election expired, because this code
didn't foresee the possibility of monitors changing ranks in-between
elections -- which doesn't happen if we specify the monmap during the
monitor's mkfs, but may happen when relying on 'mon initial peers'.

Failing to do so triggered an assertion after fixing bug #3252.

Backport: argonaut

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Joao Eduardo Luis 2012-10-04 17:34:37 +01:00
parent 35f5effa73
commit d5c3c47619

View File

@ -67,6 +67,8 @@ void Elector::start()
return;
}
dout(5) << "start -- can i be leader?" << dendl;
acked_me.clear();
// start by trying to elect me
if (epoch % 2 == 0)