Send node info message sooner (#13348)
send node info sooner
Emmanuel Vasilakis committed
Jul 11, 2022 at 12:30 UTC
7a67355e15ea1235fc46eb67f78d3a338ee66403
2 files changed
+5
-3
database/sqlite/sqlite_aclk.c
+2
-2
@@ -473,7 +473,7 @@ void aclk_database_worker(void *arg)
473
fatal_assert(0 == uv_timer_start(&timer_req, timer_cb, TIMER_PERIOD_MS, TIMER_PERIOD_MS));
474
475
// wc->retry_count = 0;
476
- wc->node_info_send = (wc->host && !localhost);
476
+ wc->node_info_send = 1;
477
// aclk_add_worker_thread(wc);
478
info("Starting ACLK sync thread for host %s -- scratch area %lu bytes", wc->host_guid, sizeof(*wc));
479
@@ -634,7 +634,7 @@ void aclk_database_worker(void *arg)
634
}
635
}
636
}
637
- if (wc->node_info_send && wc->host && localhost && claimed() && aclk_connected) {
637
+ if (wc->node_info_send && localhost && claimed() && aclk_connected) {
638
cmd.opcode = ACLK_DATABASE_NODE_INFO;
639
cmd.completion = NULL;
640
wc->node_info_send = aclk_database_enq_cmd_noblock(wc, &cmd);
database/sqlite/sqlite_aclk_node.c
+3
-1
@@ -61,8 +61,10 @@ void sql_build_node_info(struct aclk_database_worker_config *wc, struct aclk_dat
61
#ifdef ENABLE_ACLK
62
struct update_node_info node_info;
63
64
- if (!wc->host)
64
+ if (!wc->host) {
65
+ wc->node_info_send = 1;
66
return;
67
+ }
68
69
rrd_rdlock();
70
node_info.node_id = wc->node_id;