Skip to content

Commit

Permalink
Avoid scanning charts for replication status (netdata#19124)
Browse files Browse the repository at this point in the history
  • Loading branch information
stelfrag authored Dec 4, 2024
1 parent 57ee759 commit 9ae1277
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/database/sqlite/sqlite_aclk_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,6 @@ static void build_node_info(RRDHOST *host)
wc->node_collectors_send = now_realtime_sec();
}

static bool host_is_replicating(RRDHOST *host)
{
bool replicating = false;
RRDSET *st;
rrdset_foreach_reentrant(st, host) {
if (rrdset_is_replicating(st)) {
replicating = true;
break;
}
}
rrdset_foreach_done(st);
return replicating;
}

void aclk_check_node_info_and_collectors(void)
{
RRDHOST *host;
Expand Down Expand Up @@ -157,7 +143,7 @@ void aclk_check_node_info_and_collectors(void)
if (!wc->node_info_send_time && !wc->node_collectors_send)
continue;

if (unlikely(host_is_replicating(host))) {
if (unlikely(rrdhost_receiver_replicating_charts(host))) {
internal_error(true, "ACLK SYNC: Host %s is still replicating", rrdhost_hostname(host));
replicating++;
continue;
Expand Down

0 comments on commit 9ae1277

Please sign in to comment.