~ne02ptzero/libfloat

periodic: force election from followers in case of a total leader loss v1 APPLIED

Patrik Cyvoct: 1
 periodic: force election from followers in case of a total leader loss

 1 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~ne02ptzero/libfloat/patches/37524/mbox | git am -3
Learn more about email & git

[PATCH] periodic: force election from followers in case of a total leader loss Export this patch

Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
---
 periodic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/periodic.c b/periodic.c
index 40004b4..a64fe67 100644
--- a/periodic.c
+++ b/periodic.c
@@ -30,7 +30,7 @@ void libfloat_periodic(libfloat_ctx_t *ctx, uint32_t time)
                    * Hmmm, we might be partitionned, or at the very least we don't have a quorum anymore.
                    * Time to step down!
                    */
                    libfloat_become_follower(ctx, .reason = "not enought nodes reachable");
                    libfloat_become_follower(ctx, .reason = "not enough nodes reachable");
                    ERROR(ctx, "Sanity timeout has been reached (%d seconds), stepping down from leader position: reachable %d / quorum %lu (%lu)",
                          ctx->conf.sanity_timeout, nodes_reachable, ctx->n_nodes / 2 + 1, ctx->n_nodes);
                    return;
@@ -154,7 +154,7 @@ void libfloat_periodic(libfloat_ctx_t *ctx, uint32_t time)
                    {
                        /* We received a response from all the nodes (Minus myself and the potential dead-leader), and no-one has a leader, let's trigger an election */
                        ctx->gray_failures.checking = false;
                        libfloat_election_start(ctx, .reason = "Gray failures: Total leader loss");
                        libfloat_election_start(ctx, .reason = "Gray failures: Total leader loss", .force = true);
                    }
                    else if (node_responses == 0)
                    {
-- 
2.38.1