@cryptotaxi247 / netdata-1 / commits / 9ae127770

Avoid scanning charts for replication status (#19124)

Stelios Fragkakis committed Dec 4, 2024 at 23:47 UTC 9ae127770601c92c73824b30b4eb66c134b363b2
1 file changed +1 -15
src/database/sqlite/sqlite_aclk_node.c
+1 -15
@@ -116,20 +116,6 @@ static void build_node_info(RRDHOST *host)
116 wc->node_collectors_send = now_realtime_sec();
117 }
118
119 -static bool host_is_replicating(RRDHOST *host)
120 -{
121 - bool replicating = false;
122 - RRDSET *st;
123 - rrdset_foreach_reentrant(st, host) {
124 - if (rrdset_is_replicating(st)) {
125 - replicating = true;
126 - break;
127 - }
128 - }
129 - rrdset_foreach_done(st);
130 - return replicating;
131 -}
132 -
119 void aclk_check_node_info_and_collectors(void)
120 {
121 RRDHOST *host;
@@ -157,7 +143,7 @@ void aclk_check_node_info_and_collectors(void)
143 if (!wc->node_info_send_time && !wc->node_collectors_send)
144 continue;
145
160 - if (unlikely(host_is_replicating(host))) {
146 + if (unlikely(rrdhost_receiver_replicating_charts(host))) {
147 internal_error(true, "ACLK SYNC: Host %s is still replicating", rrdhost_hostname(host));
148 replicating++;
149 continue;