~ne02ptzero/libfloat

log: Only ERROR log on smaller commit_id when it is problematic v1 APPLIED

Louis Solofrizzo: 1
 log: Only ERROR log on smaller commit_id when it is problematic

 1 files changed, 4 insertions(+), 1 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/47901/mbox | git am -3
Learn more about email & git

[PATCH] log: Only ERROR log on smaller commit_id when it is problematic Export this patch

Otherwise, DEBUG it. Should generate less logs on production / tests.

Signed-off-by: Louis Solofrizzo <lsolofrizzo@scaleway.com>
---
 log.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/log.c b/log.c
index 7e4b58d..417aa16 100644
--- a/log.c
+++ b/log.c
@@ -678,6 +678,9 @@ void libfloat_append_entries_response(libfloat_ctx_t *ctx, libfloat_rpc_append_e
                {
                    /* We have 20 consecutive hertbeats telling the same story, let's believe it */

                    ERROR(ctx, "libfloat_append_entries_response: node %d: received current_index (%u) older than replicated_log (%u)",
                        node->id, resp->current_index, node->replicated_log);

                    node->announced_log_count = 0;
                    node->next_log_to_send = max(resp->current_index + 1, 1);
                    node->replicated_log = resp->current_index;
@@ -691,7 +694,7 @@ void libfloat_append_entries_response(libfloat_ctx_t *ctx, libfloat_rpc_append_e
                node->announced_log = resp->current_index;
            }

            ERROR(ctx, "libfloat_append_entries_response: node %d: received current_index (%u) older than replicated_log (%u) (count=%lu)",
            DEBUG(ctx, "libfloat_append_entries_response: node %d: received current_index (%u) older than replicated_log (%u) (count=%lu)",
                node->id, resp->current_index, node->replicated_log, node->announced_log_count);
            return;
        }
-- 
2.43.0
LG