From e8dc6d505488da231b672f2310009f6faf4f51f6 Mon Sep 17 00:00:00 2001 From: Liviu Chircu Date: Tue, 22 Oct 2024 15:04:19 +0300 Subject: [PATCH] clusterer: Add/Improve some important logs during startup sync (cherry picked from commit 2bf1bdcf5c087f16c21c99101738ed52ad8741c1) --- modules/clusterer/clusterer.c | 6 ++++-- modules/clusterer/sync.c | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/clusterer/clusterer.c b/modules/clusterer/clusterer.c index 1b200ef844c..bfd144560cd 100644 --- a/modules/clusterer/clusterer.c +++ b/modules/clusterer/clusterer.c @@ -101,8 +101,10 @@ void sync_check_timer(utime_t ticks, void *param) sr_set_status(cl_srg, STR2CI(cap->reg.sr_id), CAP_SR_SYNCED, STR2CI(CAP_SR_STATUS_STR(CAP_SR_SYNCED)), 0); sr_add_report_fmt(cl_srg, STR2CI(cap->reg.sr_id), 0, - "Donor node not found, fallback to synced state"); - LM_INFO("No donor found, falling back to synced state\n"); + "ERROR: Sync request aborted! (no donor found in due time)" + " => fallback to synced state"); + LM_ERR("Sync request aborted! (no donor found in due time)" + ", falling back to synced state\n"); /* send update about the state of this capability */ send_single_cap_update(cl, cap, 1); diff --git a/modules/clusterer/sync.c b/modules/clusterer/sync.c index 0e37046d28c..09cf6f31860 100644 --- a/modules/clusterer/sync.c +++ b/modules/clusterer/sync.c @@ -101,9 +101,14 @@ int queue_sync_request(cluster_info_t *cluster, struct local_cap *lcap) lock_release(cluster->lock); + LM_INFO("Queue'ing sync request for capability '%.*s' in cluster %d " + "(no donor available)\n", lcap->reg.name.len, lcap->reg.name.s, + cluster->cluster_id); + sr_set_status(cl_srg, STR2CI(lcap->reg.sr_id), CAP_SR_SYNC_PENDING, STR2CI(CAP_SR_STATUS_STR(CAP_SR_SYNC_PENDING)), 0); - if (sr_add_report_fmt(cl_srg, STR2CI(lcap->reg.sr_id), 0, "Sync requested")) + if (sr_add_report_fmt(cl_srg, STR2CI(lcap->reg.sr_id), 0, + "Sync request postponed! (no donor available)")) return -1; return 0; @@ -326,7 +331,7 @@ void send_sync_repl(int sender, void *param) bin_packet_t sync_end_pkt, *pkt, *next_pkt; str bin_buffer; struct local_cap *cap; - int rc, cluster_id, pkt_no; + int rc, cluster_id, pkt_no = 0; struct reply_rpc_params *p = (struct reply_rpc_params *)param; for (cap = p->cluster->capabilities; cap; cap = cap->next)