~ne02ptzero/libfloat

37ff94915193d500990271b00d01ae4efe97e817 — Louis Solofrizzo 9 days ago c03e69a master
log: Don't trigger an election when an unknown leader have a lower term

Patch: https://lists.sr.ht/~ne02ptzero/libfloat/patches/37045

Signed-off-by: Louis Solofrizzo <lsolofrizzo@scaleway.com>
Acked-by     : Patrik Cyvoct <pcyvoct@scaleway.com>

 _________________________________________
/ The only thing we learn from history is \
| that we learn nothing from history. --  |
| Hegel I know guys can't learn from      |
| yesterday ... Hegel must be taking the  |
| long view. -- John Brunner, "Stand on   |
\ Zanzibar"                               /
 -----------------------------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
1 files changed, 6 insertions(+), 0 deletions(-)

M log.c
M log.c => log.c +6 -0
@@ 406,6 406,12 @@ void libfloat_append_entries_receive(libfloat_ctx_t *ctx, libfloat_rpc_append_en
        }
        else
        {
            if (node == NULL)
            {
                /* This leader is unknown, let's not trigger an election for that */
                return;
            }

            /* Who are you and how are you in a position of leadership? */
            DEBUG(ctx, "libfloat_append_entries_receive: Dropping AE term=%d remote_term=%d", ctx->persistent.term, req->term);
            libfloat_election_start(ctx, .reason = "Dropping mismatch AE term");