]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon/ElectionLogic: tie-breaker ignore proposal from marked down mon
authorKamoltat <ksirivad@redhat.com>
Thu, 13 Jun 2024 16:17:53 +0000 (16:17 +0000)
committerKamoltat <ksirivad@redhat.com>
Thu, 18 Jul 2024 19:48:24 +0000 (19:48 +0000)
commit5d17185522a519d678ac2d0e1bb539908b1594ec
tree6593744cad18694edbd71138651e9f4aa7235897
parent05649d9200ba0e66f45385e955b028fcd5d6b7a7
mon/ElectionLogic: tie-breaker ignore proposal from marked down mon

Problem:

Monitor election gets stuck,
resulting in the cluster being
unaccessible.

Set up stretch cluster:
DC1: mon.a,mon.b
DC2: mon.c, mon.d
Arbiter: mon.e

Apply netsplit between
DC1 and DC2, wait around
10 seconds, client tried accessing
the cluster ... failed to access.

We expect the cluster to be functional
when there is netsplit.

This was due to how we suppose to
kick one DC out of quorum and keep them in the
dark until the connection comes back (netsplit gone).
However, there is a small window where the out-of-quorum
DC is able to have an influence on the tiebreaker MON
by forcing the tiebreaker MON to bump its epoch
which then it will reject the winner MON's victory
message from in-quorum DC.

Solution:
In CONNECTIVITY election strategy,
tie-breaker MON disregard any proposal that is coming
from MONs that belongs to `stretch_marked_down_mons`
set. As a result, the out-of-quorum
MONs won't get the chance to force the tie-breaker
MON to increase its epoch, hence will now accept
the victory message from the in-quorum Monitors.

Also, edited src/test/mon/test_election.cc
to include `is_stretch_marked_down_mon`
and `is_tiebreaker`,
preventing the make check from breaking.

Fixes: https://tracker.ceph.com/issues/66471
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit d3608533672d575fbc54fc965ddde93dfdb89721)
src/mon/ElectionLogic.cc
src/mon/ElectionLogic.h
src/mon/Elector.cc
src/mon/Elector.h
src/mon/MonMap.h
src/test/mon/test_election.cc