~ne02ptzero/libfloat

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

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

Details
Message ID
<20221214154558.255647-1-patrik@ptrk.io>
DKIM signature
missing
Download raw message
Patch: +2 -2
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
Details
Message ID
<20221216130035.g3xoe3zlv5es7lem@darlene>
In-Reply-To
<20221214154558.255647-1-patrik@ptrk.io> (view parent)
DKIM signature
missing
Download raw message
On Wed, Dec 14, 2022 at 04:45:58PM +0100, Patrik Cyvoct wrote:
> 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
> 

LGTM
Reply to thread Export thread (mbox)