Skip to content

Commit

Permalink
clusterer: Log all major sync stages at INFO level
Browse files Browse the repository at this point in the history
Motivation: these logs are not spammy at all, yet very useful/reassuring
to see in production after issuing data sync commands.

(cherry picked from commit 8e391c2)
  • Loading branch information
liviuchircu committed Aug 1, 2019
1 parent 9c4ce86 commit f589f6c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions modules/clusterer/sync.c
Expand Up @@ -46,8 +46,9 @@ int send_sync_req(str *capability, int cluster_id, int source_id)

rc = clusterer_send_msg(&packet, cluster_id, source_id);
if (rc == CLUSTERER_SEND_SUCCES)
LM_DBG("Sync request sent for capability: %.*s to node: %d\n",
capability->len, capability->s, source_id);
LM_INFO("Sent sync request for capability '%.*s' to node %d, "
"cluster %d\n", capability->len, capability->s, source_id,
cluster_id);

bin_free_packet(&packet);

Expand Down Expand Up @@ -324,8 +325,8 @@ int send_sync_repl(cluster_info_t *cluster, int node_id, str *cap_name)

bin_free_packet(&sync_end_pkt);

LM_DBG("Sent all sync packets for capability: %.*s to node: %d\n",
cap_name->len, cap_name->s, node_id);
LM_INFO("Sent all sync packets for capability '%.*s' to node %d, cluster "
"%d\n", cap_name->len, cap_name->s, node_id, cluster->cluster_id);

return 0;
}
Expand All @@ -339,8 +340,9 @@ void handle_sync_request(bin_packet_t *packet, cluster_info_t *cluster,

bin_pop_str(packet, &cap_name);

LM_DBG("Received sync request for capability: %.*s from: %d\n", cap_name.len,
cap_name.s, source->node_id);
LM_INFO("Received sync request for capability '%.*s' from node %d, "
"cluster %d\n", cap_name.len, cap_name.s, source->node_id,
cluster->cluster_id);

nhop = get_next_hop(source);
if (nhop > 0) {
Expand Down Expand Up @@ -405,8 +407,8 @@ void handle_sync_packet(bin_packet_t *packet, int packet_type,
next_data_chunk = NULL;
cap->reg.packet_cb(packet);
} else { /* CLUSTERER_SYNC_END */
LM_DBG("Received all sync packets for capability: %.*s\n", cap_name.len,
cap_name.s);
LM_INFO("Received all sync packets for capability '%.*s' in "
"cluster %d\n", cap_name.len, cap_name.s, cluster->cluster_id);

lock_get(cluster->lock);

Expand Down

0 comments on commit f589f6c

Please sign in to comment.