From 6b9ce1956b880e18bf3b9c5a17257b6d6064e222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Border=C3=A9?= Date: Wed, 28 Jun 2023 16:57:54 +0200 Subject: [PATCH] more debug logs --- src/client.c | 1 + src/membership.c | 1 + src/replication.c | 2 ++ src/start.c | 1 + 4 files changed, 5 insertions(+) diff --git a/src/client.c b/src/client.c index 93186a773..1923c54aa 100644 --- a/src/client.c +++ b/src/client.c @@ -155,6 +155,7 @@ static int clientChangeConfiguration( goto err_after_log_append; } + tracef("set configuration_uncommitted_index to %llu", index); r->configuration_uncommitted_index = index; return 0; diff --git a/src/membership.c b/src/membership.c index 624f19d26..afb2e12fe 100644 --- a/src/membership.c +++ b/src/membership.c @@ -169,6 +169,7 @@ int membershipUncommittedChange(struct raft *r, r->configuration = configuration; r->configuration_uncommitted_index = index; + tracef("set configuration_uncommitted_index to %llu", index); return 0; diff --git a/src/replication.c b/src/replication.c index e5d0356ed..0902af625 100644 --- a/src/replication.c +++ b/src/replication.c @@ -657,6 +657,7 @@ static int triggerActualPromotion(struct raft *r) r->leader_state.promotee_id = 0; r->configuration_uncommitted_index = logLastIndex(r->log); + tracef("configuration_uncommitted_index is %llu", r->configuration_uncommitted_index); return 0; @@ -1019,6 +1020,7 @@ static int deleteConflictingEntries(struct raft *r, /* Possibly discard uncommitted configuration changes. */ if (r->configuration_uncommitted_index >= entry_index) { + tracef("pre rollback: %llu >= %llu", r->configuration_uncommitted_index, entry_index); rv = membershipRollback(r); if (rv != 0) { return rv; diff --git a/src/start.c b/src/start.c index f9a0bdc1a..1d2f8657f 100644 --- a/src/start.c +++ b/src/start.c @@ -93,6 +93,7 @@ static int restoreEntries(struct raft *r, } conf = entry; conf_index = r->last_stored; + tracef("another configuration at index %llu", conf_index); } }