@cryptotaxi247 / netdata-1 / commits / dd7861abc

Code cleanup on ACLK messages (#19566)

* Store localhost information immediately * Fix return code on failure Use sqlite3_step_monitored * Remove get_node_list * Schedule node_state_update after 1 second Code cleanup * Code dedup aclk_create_node_instance_job to create a new node aclk_update_node_instance_job tp update node status aclk_send_node_instances uses in-memory hosts

Stelios Fragkakis committed Feb 4, 2025 at 10:04 UTC dd7861abc8063bafa263585110ac7ef22a301063
6 files changed +100 -253
src/aclk/aclk.c
+66 -125
@@ -932,153 +932,94 @@ bool aclk_host_state_update_auto(RRDHOST *host) {
932 return true;
933 }
934
935 -void aclk_host_state_update(RRDHOST *host, int cmd, int queryable)
935 +void aclk_create_node_instance_job(RRDHOST *host)
936 {
937 - ND_UUID node_id;
937 + if (unlikely(!host))
938 + return;
939
939 - if (!aclk_online())
940 + CLAIM_ID claim_id = claim_id_get();
941 + if (!claim_id_is_set(claim_id))
942 return;
943
942 - if (!UUIDiszero(host->node_id)) {
943 - node_id = host->node_id;
944 - }
945 - else {
946 - int ret = get_node_id(&host->host_id.uuid, &node_id.uuid);
947 - if (ret > 0) {
948 - // this means we were not able to check if node_id already present
949 - netdata_log_error("ACLK: Unable to check for node_id. Ignoring the host state update.");
950 - return;
951 - }
952 - if (ret < 0) {
953 - // node_id not found
954 - aclk_query_t create_query;
955 - create_query = aclk_query_new(REGISTER_NODE);
956 - CLAIM_ID claim_id = claim_id_get();
957 -
958 - node_instance_creation_t node_instance_creation = {
959 - .claim_id = claim_id_is_set(claim_id) ? claim_id.str : NULL,
960 - .hops = rrdhost_ingestion_hops(host),
961 - .hostname = rrdhost_hostname(host),
962 - .machine_guid = host->machine_guid};
963 -
964 - create_query->data.bin_payload.payload =
965 - generate_node_instance_creation(&create_query->data.bin_payload.size, &node_instance_creation);
966 -
967 - create_query->data.bin_payload.topic = ACLK_TOPICID_CREATE_NODE;
968 - create_query->data.bin_payload.msg_name = "CreateNodeInstance";
969 - nd_log(NDLS_DAEMON, NDLP_DEBUG,
970 - "Registering host=%s, hops=%d", host->machine_guid,
971 - rrdhost_ingestion_hops(host));
944 + aclk_query_t query = aclk_query_new(REGISTER_NODE);
945 + int32_t hops = rrdhost_ingestion_hops(host);
946 + node_instance_creation_t node_instance_creation = {
947 + .hops = hops,
948 + .hostname = rrdhost_hostname(host),
949 + .machine_guid = host->machine_guid,
950 + .claim_id = claim_id.str
951 + };
952
973 - aclk_add_job(create_query);
974 - return;
975 - }
976 - }
953 + query->data.bin_payload.topic = ACLK_TOPICID_CREATE_NODE;
954 + query->data.bin_payload.msg_name = "CreateNodeInstance";
955 + query->data.bin_payload.payload = generate_node_instance_creation(&query->data.bin_payload.size, &node_instance_creation);
956 +
957 + nd_log_daemon(NDLP_DEBUG, "Queuing registration for host=%s, hops=%d", host->machine_guid, hops);
958 +
959 + aclk_add_job(query);
960 +}
961 +
962 +void aclk_update_node_instance_job(RRDHOST *host, int live, int queryable)
963 +{
964 + if (unlikely(!host))
965 + return;
966 +
967 + CLAIM_ID claim_id = claim_id_get();
968 + if (!claim_id_is_set(claim_id))
969 + return;
970
971 aclk_query_t query = aclk_query_new(NODE_STATE_UPDATE);
972 +
973 + int32_t hops = rrdhost_ingestion_hops(host);
974 node_instance_connection_t node_state_update = {
980 - .hops = rrdhost_ingestion_hops(host),
981 - .live = cmd,
975 + .claim_id = claim_id.str,
976 + .hops = hops,
977 + .live = live,
978 .queryable = queryable,
983 - .session_id = aclk_session_newarch
984 - };
985 - node_state_update.node_id = mallocz(UUID_STR_LEN);
986 - uuid_unparse_lower(node_id.uuid, (char*)node_state_update.node_id);
979 + .session_id = aclk_session_newarch};
980
988 - node_state_update.capabilities = aclk_get_agent_capas();
981 + char node_id[UUID_STR_LEN];
982 + uuid_unparse_lower(host->node_id.uuid, node_id);
983
990 - CLAIM_ID claim_id = claim_id_get();
991 - node_state_update.claim_id = claim_id_is_set(claim_id) ? claim_id.str : NULL;
984 + node_state_update.node_id = node_id;
985 + node_state_update.capabilities = aclk_get_node_instance_capas(host);
986 +
987 + query->data.bin_payload.topic = ACLK_TOPICID_NODE_CONN;
988 + query->data.bin_payload.msg_name = "UpdateNodeInstanceConnection";
989 query->data.bin_payload.payload = generate_node_instance_connection(&query->data.bin_payload.size, &node_state_update);
990
994 - nd_log(NDLS_DAEMON, NDLP_DEBUG,
995 - "Queuing status update for node=%s, live=%d, hops=%d, queryable=%d",
996 - (char*)node_state_update.node_id, cmd,
997 - rrdhost_ingestion_hops(host), queryable);
991 + nd_log_daemon(
992 + NDLP_DEBUG,
993 + "Queuing status update for node=%s, live=%d, hops=%d, queryable=%d",
994 + (char *)node_state_update.node_id,
995 + live,
996 + hops,
997 + queryable);
998
999 - freez((void*)node_state_update.node_id);
1000 - query->data.bin_payload.msg_name = "UpdateNodeInstanceConnection";
1001 - query->data.bin_payload.topic = ACLK_TOPICID_NODE_CONN;
999 + freez((void *)node_state_update.capabilities);
1000 aclk_add_job(query);
1001 }
1002
1005 -void aclk_send_node_instances(mqtt_wss_client client)
1003 +void aclk_host_state_update(RRDHOST *host, int live, int queryable)
1004 {
1007 - struct node_instance_list *list_head = get_node_list();
1008 - struct node_instance_list *list = list_head;
1009 - if (unlikely(!list)) {
1010 - error_report("Failure to get_node_list from DB!");
1011 - sleep_usec(USEC_PER_SEC);
1012 - aclk_query_t query = aclk_query_new(SEND_NODE_INSTANCES);
1013 - aclk_add_job(query);
1005 + if (!aclk_online())
1006 return;
1015 - }
1016 - while (!uuid_is_null(list->host_id)) {
1017 - if (!uuid_is_null(list->node_id)) {
1018 - aclk_query_t query = aclk_query_new(NODE_STATE_UPDATE);
1019 - node_instance_connection_t node_state_update = {
1020 - .live = list->live,
1021 - .hops = list->hops,
1022 - .queryable = 1,
1023 - .session_id = aclk_session_newarch
1024 - };
1025 - node_state_update.node_id = mallocz(UUID_STR_LEN);
1026 - uuid_unparse_lower(list->node_id, (char*)node_state_update.node_id);
1027 -
1028 - char host_id[UUID_STR_LEN];
1029 - uuid_unparse_lower(list->host_id, host_id);
1030 -
1031 - RRDHOST *host = rrdhost_find_by_guid(host_id);
1032 - if (unlikely(!host)) {
1033 - freez((void*)node_state_update.node_id);
1034 - freez(query);
1035 - continue;
1036 - }
1037 - node_state_update.capabilities = aclk_get_node_instance_capas(host);
1038 -
1039 - CLAIM_ID claim_id = claim_id_get();
1040 - node_state_update.claim_id = claim_id_is_set(claim_id) ? claim_id.str : NULL;
1041 - query->data.bin_payload.payload = generate_node_instance_connection(&query->data.bin_payload.size, &node_state_update);
1007
1043 - nd_log(NDLS_DAEMON, NDLP_DEBUG,
1044 - "Queuing status update for node=%s, live=%d, hops=%d, queryable=1",
1045 - (char*)node_state_update.node_id, list->live, list->hops);
1046 -
1047 - freez((void*)node_state_update.capabilities);
1048 - freez((void*)node_state_update.node_id);
1049 - query->data.bin_payload.msg_name = "UpdateNodeInstanceConnection";
1050 - query->data.bin_payload.topic = ACLK_TOPICID_NODE_CONN;
1051 - send_bin_msg(client, query);
1052 - aclk_query_free(query);
1053 - } else {
1054 - aclk_query_t create_query;
1055 - create_query = aclk_query_new(REGISTER_NODE);
1056 - node_instance_creation_t node_instance_creation = {
1057 - .hops = list->hops,
1058 - .hostname = list->hostname,
1059 - };
1060 - node_instance_creation.machine_guid = mallocz(UUID_STR_LEN);
1061 - uuid_unparse_lower(list->host_id, (char*)node_instance_creation.machine_guid);
1062 - create_query->data.bin_payload.topic = ACLK_TOPICID_CREATE_NODE;
1063 - create_query->data.bin_payload.msg_name = "CreateNodeInstance";
1064 -
1065 - CLAIM_ID claim_id = claim_id_get();
1066 - node_instance_creation.claim_id = claim_id_is_set(claim_id) ? claim_id.str : NULL,
1067 - create_query->data.bin_payload.payload = generate_node_instance_creation(&create_query->data.bin_payload.size, &node_instance_creation);
1068 -
1069 - nd_log(NDLS_DAEMON, NDLP_DEBUG,
1070 - "Queuing registration for host=%s, hops=%d",
1071 - (char*)node_instance_creation.machine_guid, list->hops);
1072 -
1073 - freez((void *)node_instance_creation.machine_guid);
1074 - send_bin_msg(client, create_query);
1075 - aclk_query_free(create_query);
1076 - }
1077 - freez(list->hostname);
1008 + if (uuid_is_null(host->node_id.uuid))
1009 + aclk_create_node_instance_job(host);
1010 + else
1011 + aclk_update_node_instance_job(host, live, queryable);
1012 +}
1013
1079 - list++;
1014 +void aclk_send_node_instances()
1015 +{
1016 + RRDHOST *host;
1017 + dfe_start_reentrant(rrdhost_root_index, host)
1018 + {
1019 + int live = rrdhost_ingestion_status(host) == RRDHOST_INGEST_STATUS_ONLINE ? 1 : 0;
1020 + aclk_host_state_update(host, live, 1);
1021 }
1081 - freez(list_head);
1022 + dfe_done(host);
1023 }
1024
1025 void aclk_send_bin_msg(char *msg, size_t msg_len, enum aclk_topics subtopic, const char *msgname)
src/aclk/aclk.h
+2 -2
@@ -93,10 +93,10 @@ extern struct aclk_shared_state {
93 int mqtt_shutdown_msg_rcvd;
94 } aclk_shared_state;
95
96 -void aclk_host_state_update(RRDHOST *host, int cmd, int queryable);
96 +void aclk_host_state_update(RRDHOST *host, int live, int queryable);
97 bool aclk_host_state_update_auto(RRDHOST *host);
98
99 -void aclk_send_node_instances(mqtt_wss_client client);
99 +void aclk_send_node_instances();
100
101 void aclk_send_bin_msg(char *msg, size_t msg_len, enum aclk_topics subtopic, const char *msgname);
102
src/database/rrdhost.c
+6
@@ -499,6 +499,12 @@ RRDHOST *rrdhost_create(
499
500 if(!archived) {
501 rrdhost_flag_set(host, RRDHOST_FLAG_METADATA_INFO | RRDHOST_FLAG_METADATA_UPDATE);
502 + if (is_localhost) {
503 + BUFFER *buf = buffer_create(0, NULL);
504 + size_t query_counter = 0;
505 + store_host_info_and_metadata(host, buf, &query_counter);
506 + buffer_free(buf);
507 + }
508 rrdhost_load_rrdcontext_data(host);
509 ml_host_new(host);
510 } else
src/database/sqlite/sqlite_aclk.c
+4 -29
@@ -13,7 +13,7 @@ void sanity_check(void) {
13 #include "../aclk_query.h"
14 #include "../aclk_capas.h"
15
16 -static void create_node_instance_result_job(mqtt_wss_client client __maybe_unused, const char *machine_guid, const char *node_id)
16 +static void create_node_instance_result_job(const char *machine_guid, const char *node_id)
17 {
18 nd_uuid_t host_uuid, node_uuid;
19
@@ -33,32 +33,7 @@ static void create_node_instance_result_job(mqtt_wss_client client __maybe_unuse
33 return;
34 }
35 sql_update_node_id(&host_uuid, &node_uuid);
36 - schedule_node_state_update(host, 5000);
37 -//
38 -// aclk_query_t query = aclk_query_new(NODE_STATE_UPDATE);
39 -// node_instance_connection_t node_state_update = {
40 -// .hops = 1,
41 -// .live = 0,
42 -// .queryable = 1,
43 -// .session_id = aclk_session_newarch,
44 -// .node_id = node_id,
45 -// .capabilities = NULL};
46 -//
47 -// node_state_update.live = rrdhost_is_local(host) ? 1 : 0;
48 -// node_state_update.hops = rrdhost_ingestion_hops(host);
49 -// node_state_update.capabilities = aclk_get_node_instance_capas(host);
50 -// schedule_node_state_update(host, 5000);
51 -//
52 -// CLAIM_ID claim_id = claim_id_get();
53 -// node_state_update.claim_id = claim_id_is_set(claim_id) ? claim_id.str : NULL;
54 -// query->data.bin_payload.payload = generate_node_instance_connection(&query->data.bin_payload.size, &node_state_update);
55 -//
56 -// freez((void *)node_state_update.capabilities);
57 -//
58 -// query->data.bin_payload.msg_name = "UpdateNodeInstanceConnection";
59 -// query->data.bin_payload.topic = ACLK_TOPICID_NODE_CONN;
60 -//
61 -// aclk_add_job(query);
36 + schedule_node_state_update(host, 1000);
37 }
38
39 struct aclk_sync_config_s {
@@ -395,7 +370,7 @@ static void aclk_run_query(struct aclk_sync_config_s *config, aclk_query_t query
370 break;
371 case SEND_NODE_INSTANCES:
372 worker_is_busy(UV_EVENT_SEND_NODE_INSTANCES);
398 - aclk_send_node_instances(config->client);
373 + aclk_send_node_instances();
374 ok_to_send = false;
375 break;
376 case ALERT_START_STREAMING:
@@ -410,7 +385,7 @@ static void aclk_run_query(struct aclk_sync_config_s *config, aclk_query_t query
385 break;
386 case CREATE_NODE_INSTANCE:
387 worker_is_busy(UV_EVENT_CREATE_NODE_INSTANCE);
413 - create_node_instance_result_job(config->client, query->machine_guid, query->data.node_id);
388 + create_node_instance_result_job(query->machine_guid, query->data.node_id);
389 ok_to_send = false;
390 break;
391
src/database/sqlite/sqlite_metadata.c
+21 -86
@@ -511,74 +511,6 @@ done:
511 SQLITE_FINALIZE(res);
512 }
513
514 -#define SQL_GET_NODE_INSTANCE_LIST \
515 - "SELECT ni.node_id, ni.host_id, h.hostname " \
516 - "FROM node_instance ni, host h WHERE ni.host_id = h.host_id AND h.hops >=0"
517 -
518 -struct node_instance_list *get_node_list(void)
519 -{
520 - struct node_instance_list *node_list = NULL;
521 - sqlite3_stmt *res = NULL;
522 -
523 - if (!REQUIRE_DB(db_meta))
524 - return NULL;
525 -
526 - if (!PREPARE_STATEMENT(db_meta, SQL_GET_NODE_INSTANCE_LIST, &res))
527 - return NULL;
528 -
529 - int row = 0;
530 - char host_guid[UUID_STR_LEN];
531 - while (sqlite3_step_monitored(res) == SQLITE_ROW)
532 - row++;
533 -
534 - if (row == 0)
535 - return NULL;
536 -
537 - if (sqlite3_reset(res) != SQLITE_OK) {
538 - error_report("Failed to reset the prepared statement while fetching node instance information");
539 - goto failed;
540 - }
541 - node_list = callocz(row + 1, sizeof(*node_list));
542 - int max_rows = row;
543 - row = 0;
544 - // TODO: Check to remove lock
545 - rrd_rdlock();
546 - while (sqlite3_step_monitored(res) == SQLITE_ROW) {
547 - if (sqlite3_column_bytes(res, 0) == sizeof(nd_uuid_t))
548 - uuid_copy(node_list[row].node_id, *((nd_uuid_t *)sqlite3_column_blob(res, 0)));
549 - if (sqlite3_column_bytes(res, 1) == sizeof(nd_uuid_t)) {
550 - nd_uuid_t *host_id = (nd_uuid_t *)sqlite3_column_blob(res, 1);
551 - uuid_unparse_lower(*host_id, host_guid);
552 - RRDHOST *host = rrdhost_find_by_guid(host_guid);
553 - if (!host)
554 - continue;
555 -
556 - if (rrdhost_flag_check(host, RRDHOST_FLAG_PENDING_CONTEXT_LOAD)) {
557 - nd_log_limit_static_global_var(erl, 1, 0);
558 - nd_log_limit(&erl, NDLS_DAEMON, NDLP_INFO,
559 - "ACLK: 'host:%s' skipping get node list because context is initializing", rrdhost_hostname(host));
560 - continue;
561 - }
562 -
563 - uuid_copy(node_list[row].host_id, *host_id);
564 - node_list[row].queryable = 1;
565 - node_list[row].live = rrdhost_ingestion_status(host) == RRDHOST_INGEST_STATUS_ONLINE ? 1 : 0;
566 - node_list[row].hops = rrdhost_ingestion_hops(host);
567 - node_list[row].hostname =
568 - sqlite3_column_bytes(res, 2) ? strdupz((char *)sqlite3_column_text(res, 2)) : NULL;
569 - }
570 - row++;
571 - if (row == max_rows)
572 - break;
573 - }
574 - rrd_rdunlock();
575 -
576 -failed:
577 - SQLITE_FINALIZE(res);
578 -
579 - return node_list;
580 -}
581 -
514 #define SQL_GET_HOST_NODE_ID "SELECT node_id FROM node_instance WHERE host_id = @host_id"
515
516 void sql_load_node_id(RRDHOST *host)
@@ -994,7 +926,7 @@ static int store_claim_id(nd_uuid_t *host_id, nd_uuid_t *claim_id)
926 SQLITE_BIND_FAIL(done, sqlite3_bind_null(res, ++param));
927
928 param = 0;
997 - rc = execute_insert(res);
929 + rc = sqlite3_step_monitored(res);
930 if (unlikely(rc != SQLITE_DONE))
931 error_report("Failed to store host claim id rc = %d", rc);
932
@@ -1141,7 +1073,7 @@ static int store_chart_metadata(RRDSET *st, sqlite3_stmt **res)
1073 return 1;
1074 }
1075
1144 - int rc = SQLITE_DONE;
1076 + int rc = 1;
1077 int param = 0;
1078 SQLITE_BIND_FAIL(done, sqlite3_bind_blob(*res, ++param, &st->chart_uuid, sizeof(st->chart_uuid), SQLITE_STATIC));
1079 SQLITE_BIND_FAIL(done, sqlite3_bind_blob(*res, ++param, &st->rrdhost->host_id.uuid, sizeof(st->rrdhost->host_id.uuid), SQLITE_STATIC));
@@ -1184,7 +1116,7 @@ static bool store_dimension_metadata(RRDDIM *rd, sqlite3_stmt **res)
1116 return 1;
1117 }
1118
1187 - int rc = SQLITE_DONE;
1119 + int rc = 1;
1120 int param = 0;
1121
1122 nd_uuid_t *rd_uuid = uuidmap_uuid_ptr(rd->uuid);
@@ -2213,9 +2145,6 @@ static void metadata_scan_host(RRDHOST *host, BUFFER *work_buffer, size_t *query
2145
2146 static void store_host_and_system_info(RRDHOST *host, size_t *query_counter)
2147 {
2216 - if (!rrdhost_flag_check(host, RRDHOST_FLAG_METADATA_INFO))
2217 - return;
2218 -
2148 rrdhost_flag_clear(host, RRDHOST_FLAG_METADATA_INFO);
2149
2150 if (unlikely(store_host_systeminfo(host))) {
@@ -2361,9 +2290,6 @@ static void store_alert_transitions(struct judy_list_t *pending_alert_list)
2290
2291 static void meta_store_host_labels(RRDHOST *host, BUFFER *work_buffer, size_t *query_counter)
2292 {
2364 - if (likely(!rrdhost_flag_check(host, RRDHOST_FLAG_METADATA_LABELS)))
2365 - return;
2366 -
2293 rrdhost_flag_clear(host, RRDHOST_FLAG_METADATA_LABELS);
2294
2295 int rc = exec_statement_with_uuid(SQL_DELETE_HOST_LABELS, &host->host_id.uuid);
@@ -2393,9 +2319,6 @@ static void meta_store_host_labels(RRDHOST *host, BUFFER *work_buffer, size_t *q
2319
2320 static void store_host_claim_id(RRDHOST *host, size_t *query_counter)
2321 {
2396 - if (likely(!rrdhost_flag_check(host, RRDHOST_FLAG_METADATA_CLAIMID)))
2397 - return;
2398 -
2322 rrdhost_flag_clear(host, RRDHOST_FLAG_METADATA_CLAIMID);
2323 int rc;
2324 ND_UUID uuid = claim_id_get_uuid();
@@ -2415,6 +2338,22 @@ static void store_host_claim_id(RRDHOST *host, size_t *query_counter)
2338 duration_snprintf(var_name, sizeof(var_name), \
2339 (int64_t)((end) - (start)), unit, true)
2340
2341 +
2342 +void store_host_info_and_metadata(RRDHOST *host, BUFFER *work_buffer, size_t *query_counter)
2343 +{
2344 + // Store labels (if needed)
2345 + if (unlikely(rrdhost_flag_check(host, RRDHOST_FLAG_METADATA_LABELS)))
2346 + meta_store_host_labels(host, work_buffer, query_counter);
2347 +
2348 + // Store claim id (if needed)
2349 + if (unlikely(rrdhost_flag_check(host, RRDHOST_FLAG_METADATA_CLAIMID)))
2350 + store_host_claim_id(host, query_counter);
2351 +
2352 + // Store host and system info (if needed);
2353 + if (rrdhost_flag_check(host, RRDHOST_FLAG_METADATA_INFO))
2354 + store_host_and_system_info(host, query_counter);
2355 +}
2356 +
2357 // Worker thread to scan hosts for pending metadata to store
2358 static void start_metadata_hosts(uv_work_t *req)
2359 {
@@ -2445,14 +2384,10 @@ static void start_metadata_hosts(uv_work_t *req)
2384 rrdhost_flag_clear(host,RRDHOST_FLAG_METADATA_UPDATE);
2385
2386 worker_is_busy(UV_EVENT_STORE_HOST);
2448 - // Store labels (if needed)
2449 - meta_store_host_labels(host, work_buffer, &query_counter);
2387
2451 - // Store claim id (if needed)
2452 - store_host_claim_id(host, &query_counter);
2388 + // store labels, claim_id, host and system info (if needed)
2389 + store_host_info_and_metadata(host, work_buffer, &query_counter);
2390
2454 - // Store host and system info (if needed);
2455 - store_host_and_system_info(host, &query_counter);
2391 worker_is_idle();
2392
2393 metadata_scan_host(host, work_buffer, &query_counter, shutting_down);
src/database/sqlite/sqlite_metadata.h
+1 -11
@@ -15,16 +15,6 @@ typedef enum event_log_type {
15 } event_log_type_t;
16 void get_agent_event_time_median_init(void);
17
18 -// return a node list
19 -struct node_instance_list {
20 - nd_uuid_t node_id;
21 - nd_uuid_t host_id;
22 - char *hostname;
23 - int live;
24 - int queryable;
25 - int hops;
26 -};
27 -
18 typedef enum db_check_action_type {
19 DB_CHECK_NONE = (1 << 0),
20 DB_CHECK_RECLAIM_SPACE = (1 << 1),
@@ -49,7 +39,6 @@ int sql_metadata_cache_stats(int op);
39
40 int get_node_id(nd_uuid_t *host_id, nd_uuid_t *node_id);
41 void sql_update_node_id(nd_uuid_t *host_id, nd_uuid_t *node_id);
52 -struct node_instance_list *get_node_list(void);
42 void sql_load_node_id(RRDHOST *host);
43
44 // Help build archived hosts in memory when agent starts
@@ -71,6 +60,7 @@ void commit_alert_transitions(RRDHOST *host);
60 void metadata_sync_shutdown_background(void);
61 void metadata_sync_shutdown_background_wait(void);
62 void metadata_queue_ctx_host_cleanup(nd_uuid_t *host_uuid, const char *context);
63 +void store_host_info_and_metadata(RRDHOST *host, BUFFER *work_buffer, size_t *query_counter);
64
65 // UNIT TEST
66 int metadata_unittest(void);