Skip to content

Commit

Permalink
clusterer: Add/Improve some important logs during startup sync
Browse files Browse the repository at this point in the history
(cherry picked from commit 2bf1bdc)
  • Loading branch information
liviuchircu committed Oct 22, 2024
1 parent 3de61d3 commit e8dc6d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions modules/clusterer/clusterer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
9 changes: 7 additions & 2 deletions modules/clusterer/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e8dc6d5

Please sign in to comment.