diff options
author | vkalintiris <vasilis@netdata.cloud> | 2023-08-03 13:13:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-03 13:13:36 +0300 |
commit | 0e230a260ec7d8b4d6dc5c7165da6ab103d096b3 (patch) | |
tree | b46528e5ace00358c342ea3d571d85bda5c546ed /database | |
parent | 72549b3a2247f763180925d7c84b0eee8086fa14 (diff) |
Revert "Refactor RRD code. (#15423)" (#15723)
This reverts commit 440bd51e08fdfa2a4daa191fb68643456028a753.
dbengine was still being used for non-zero tiers
even on non-dbengine modes.
Diffstat (limited to 'database')
47 files changed, 2198 insertions, 2132 deletions
diff --git a/database/contexts/api_v2.c b/database/contexts/api_v2.c index ac6e9c4032..1f65a6df8b 100644 --- a/database/contexts/api_v2.c +++ b/database/contexts/api_v2.c @@ -802,7 +802,7 @@ static void rrdcontext_to_json_v2_rrdhost(BUFFER *wb, RRDHOST *host, struct rrdc { buffer_json_member_add_string(wb, "status", rrdhost_db_status_to_string(s.db.status)); buffer_json_member_add_string(wb, "liveness", rrdhost_db_liveness_to_string(s.db.liveness)); - buffer_json_member_add_string(wb, "mode", storage_engine_name(s.db.storage_engine_id)); + buffer_json_member_add_string(wb, "mode", rrd_memory_mode_name(s.db.mode)); buffer_json_member_add_time_t(wb, "first_time", s.db.first_time_s); buffer_json_member_add_time_t(wb, "last_time", s.db.last_time_s); buffer_json_member_add_uint64(wb, "metrics", s.db.metrics); @@ -989,9 +989,9 @@ void buffer_json_agents_v2(BUFFER *wb, struct query_timings *timings, time_t now else buffer_json_member_add_object(wb, "agent"); - buffer_json_member_add_string(wb, "mg", rrdb.localhost->machine_guid); - buffer_json_member_add_uuid(wb, "nd", rrdb.localhost->node_id); - buffer_json_member_add_string(wb, "nm", rrdhost_hostname(rrdb.localhost)); + buffer_json_member_add_string(wb, "mg", localhost->machine_guid); + buffer_json_member_add_uuid(wb, "nd", localhost->node_id); + buffer_json_member_add_string(wb, "nm", rrdhost_hostname(localhost)); buffer_json_member_add_time_t(wb, "now", now_s); if(array) @@ -1005,13 +1005,14 @@ void buffer_json_agents_v2(BUFFER *wb, struct query_timings *timings, time_t now buffer_json_cloud_status(wb, now_s); buffer_json_member_add_array(wb, "db_size"); - for (size_t tier = 0; tier < rrdb.storage_tiers; tier++) { - STORAGE_ENGINE_ID storage_engine_id = rrdb.localhost->db[tier].id; + for (size_t tier = 0; tier < storage_tiers; tier++) { + STORAGE_ENGINE *eng = localhost->db[tier].eng; + if (!eng) continue; - size_t max = storage_engine_disk_space_max(storage_engine_id, rrdb.localhost->db[tier].instance); - size_t used = storage_engine_disk_space_used(storage_engine_id, rrdb.localhost->db[tier].instance); - time_t first_time_s = storage_engine_global_first_time_s(storage_engine_id, rrdb.localhost->db[tier].instance); - size_t currently_collected_metrics = storage_engine_collected_metrics(storage_engine_id, rrdb.localhost->db[tier].instance); + size_t max = storage_engine_disk_space_max(eng->backend, localhost->db[tier].instance); + size_t used = storage_engine_disk_space_used(eng->backend, localhost->db[tier].instance); + time_t first_time_s = storage_engine_global_first_time_s(eng->backend, localhost->db[tier].instance); + size_t currently_collected_metrics = storage_engine_collected_metrics(eng->backend, localhost->db[tier].instance); NETDATA_DOUBLE percent; if (used && max) @@ -1267,7 +1268,7 @@ static void contexts_v2_alert_config_to_json_from_sql_alert_config_data(struct s { buffer_json_member_add_string(wb, "type", "agent"); buffer_json_member_add_string(wb, "exec", t->notification.exec ? t->notification.exec : NULL); - buffer_json_member_add_string(wb, "to", t->notification.to_key ? t->notification.to_key : string2str(rrdb.localhost->health.health_default_recipient)); + buffer_json_member_add_string(wb, "to", t->notification.to_key ? t->notification.to_key : string2str(localhost->health.health_default_recipient)); buffer_json_member_add_string(wb, "delay", t->notification.delay); buffer_json_member_add_string(wb, "repeat", t->notification.repeat); buffer_json_member_add_string(wb, "options", t->notification.options); @@ -1584,7 +1585,7 @@ static void contexts_v2_alert_transition_callback(struct sql_alert_transition_da [ATF_CLASS] = t->classification, [ATF_TYPE] = t->type, [ATF_COMPONENT] = t->component, - [ATF_ROLE] = t->recipient && *t->recipient ? t->recipient : string2str(rrdb.localhost->health.health_default_recipient), + [ATF_ROLE] = t->recipient && *t->recipient ? t->recipient : string2str(localhost->health.health_default_recipient), [ATF_NODE] = machine_guid, [ATF_ALERT_NAME] = t->alert_name, [ATF_CHART_NAME] = t->chart_name, @@ -1754,9 +1755,9 @@ static void contexts_v2_alert_transitions_to_json(BUFFER *wb, struct rrdcontext_ buffer_json_member_add_time_t(wb, "delay", t->delay); buffer_json_member_add_time_t(wb, "delay_up_to_time", t->delay_up_to_timestamp); health_entry_flags_to_json_array(wb, "flags", t->flags); - buffer_json_member_add_string(wb, "exec", *t->exec ? t->exec : string2str(rrdb.localhost->health.health_default_exec)); + buffer_json_member_add_string(wb, "exec", *t->exec ? t->exec : string2str(localhost->health.health_default_exec)); buffer_json_member_add_uint64(wb, "exec_code", t->exec_code); - buffer_json_member_add_string(wb, "to", *t->recipient ? t->recipient : string2str(rrdb.localhost->health.health_default_recipient)); + buffer_json_member_add_string(wb, "to", *t->recipient ? t->recipient : string2str(localhost->health.health_default_recipient)); } buffer_json_object_close(wb); // notification } diff --git a/database/contexts/internal.h b/database/contexts/internal.h index 81b4271347..04ad0883a3 100644 --- a/database/contexts/internal.h +++ b/database/contexts/internal.h @@ -8,6 +8,7 @@ #include "../../aclk/schema-wrappers/context.h" #include "../../aclk/aclk_contexts_api.h" #include "../../aclk/aclk.h" +#include "../storage_engine.h" #define MESSAGES_PER_BUNDLE_TO_SEND_TO_HUB_PER_HOST 5000 #define FULL_RETENTION_SCAN_DELAY_AFTER_DB_ROTATION_SECS 120 diff --git a/database/contexts/query_scope.c b/database/contexts/query_scope.c index a7f8488ca3..f3bcd0b3fa 100644 --- a/database/contexts/query_scope.c +++ b/database/contexts/query_scope.c @@ -17,7 +17,7 @@ ssize_t query_scope_foreach_host(SIMPLE_PATTERN *scope_hosts_sp, SIMPLE_PATTERN uint64_t a_hash = 0; uint64_t t_hash = 0; - dfe_start_read(rrdb.rrdhost_root_index, host) { + dfe_start_read(rrdhost_root_index, host) { if(host->node_id) uuid_unparse_lower(*host->node_id, host_node_id_str); else diff --git a/database/contexts/query_target.c b/database/contexts/query_target.c index 0c08dffd70..16e1a73c97 100644 --- a/database/contexts/query_target.c +++ b/database/contexts/query_target.c @@ -211,19 +211,19 @@ typedef struct query_target_locals { QUERY_NODE *qn; // temp to pass on callbacks, ignore otherwise - no need to free } QUERY_TARGET_LOCALS; -STORAGE_ENGINE_ID query_metric_storage_engine(QUERY_TARGET *qt, QUERY_METRIC *qm, size_t tier) { +struct storage_engine *query_metric_storage_engine(QUERY_TARGET *qt, QUERY_METRIC *qm, size_t tier) { QUERY_NODE *qn = query_node(qt, qm->link.query_node_id); - return qn->rrdhost->db[tier].id; + return qn->rrdhost->db[tier].eng; } static inline void query_metric_release(QUERY_TARGET *qt, QUERY_METRIC *qm) { qm->plan.used = 0; // reset the tiers - for(size_t tier = 0; tier < rrdb.storage_tiers ;tier++) { + for(size_t tier = 0; tier < storage_tiers ;tier++) { if(qm->tiers[tier].db_metric_handle) { - STORAGE_ENGINE_ID storage_engine_id = query_metric_storage_engine(qt, qm, tier); - storage_engine_metric_release(storage_engine_id, qm->tiers[tier].db_metric_handle); + STORAGE_ENGINE *eng = query_metric_storage_engine(qt, qm, tier); + eng->api.metric_release(qm->tiers[tier].db_metric_handle); qm->tiers[tier].db_metric_handle = NULL; } } @@ -240,26 +240,26 @@ static bool query_metric_add(QUERY_TARGET_LOCALS *qtl, QUERY_NODE *qn, QUERY_CON size_t tiers_added = 0; struct { - STORAGE_ENGINE_ID storage_engine_id; + STORAGE_ENGINE *eng; STORAGE_METRIC_HANDLE *db_metric_handle; time_t db_first_time_s; time_t db_last_time_s; time_t db_update_every_s; - } tier_retention[rrdb.storage_tiers]; + } tier_retention[storage_tiers]; - for (size_t tier = 0; tier < rrdb.storage_tiers; tier++) { - STORAGE_ENGINE_ID storage_engine_id = qn->rrdhost->db[tier].id; - tier_retention[tier].storage_engine_id = storage_engine_id; + for (size_t tier = 0; tier < storage_tiers; tier++) { + STORAGE_ENGINE *eng = qn->rrdhost->db[tier].eng; + tier_retention[tier].eng = eng; tier_retention[tier].db_update_every_s = (time_t) (qn->rrdhost->db[tier].tier_grouping * ri->update_every_s); if(rm->rrddim && rm->rrddim->tiers[tier].db_metric_handle) - tier_retention[tier].db_metric_handle = storage_engine_metric_dup(rm->rrddim->rrdset->storage_engine_id, rm->rrddim->tiers[tier].db_metric_handle); + tier_retention[tier].db_metric_handle = eng->api.metric_dup(rm->rrddim->tiers[tier].db_metric_handle); else - tier_retention[tier].db_metric_handle = storage_engine_metric_get(qn->rrdhost->db[tier].id, qn->rrdhost->db[tier].instance, &rm->uuid); + tier_retention[tier].db_metric_handle = eng->api.metric_get(qn->rrdhost->db[tier].instance, &rm->uuid); if(tier_retention[tier].db_metric_handle) { - tier_retention[tier].db_first_time_s = storage_engine_oldest_time_s(tier_retention[tier].storage_engine_id, tier_retention[tier].db_metric_handle); - tier_retention[tier].db_last_time_s = storage_engine_latest_time_s(tier_retention[tier].storage_engine_id, tier_retention[tier].db_metric_handle); + tier_retention[tier].db_first_time_s = storage_engine_oldest_time_s(tier_retention[tier].eng->backend, tier_retention[tier].db_metric_handle); + tier_retention[tier].db_last_time_s = storage_engine_latest_time_s(tier_retention[tier].eng->backend, tier_retention[tier].db_metric_handle); if(!common_first_time_s) common_first_time_s = tier_retention[tier].db_first_time_s; @@ -285,7 +285,7 @@ static bool query_metric_add(QUERY_TARGET_LOCALS *qtl, QUERY_NODE *qn, QUERY_CON } } - for (size_t tier = 0; tier < rrdb.storage_tiers; tier++) { + for (size_t tier = 0; tier < storage_tiers; tier++) { if(!qt->db.tiers[tier].update_every || (tier_retention[tier].db_update_every_s && tier_retention[tier].db_update_every_s < qt->db.tiers[tier].update_every)) qt->db.tiers[tier].update_every = tier_retention[tier].db_update_every_s; @@ -329,8 +329,8 @@ static bool query_metric_add(QUERY_TARGET_LOCALS *qtl, QUERY_NODE *qn, QUERY_CON if (!qt->db.last_time_s || common_last_time_s > qt->db.last_time_s) qt->db.last_time_s = common_last_time_s; - for (size_t tier = 0; tier < rrdb.storage_tiers; tier++) { - internal_fatal(tier_retention[tier].storage_engine_id != query_metric_storage_engine(qt, qm, tier), "QUERY TARGET: storage engine mismatch"); + for (size_t tier = 0; tier < storage_tiers; tier++) { + internal_fatal(tier_retention[tier].eng != query_metric_storage_engine(qt, qm, tier), "QUERY TARGET: storage engine mismatch"); qm->tiers[tier].db_metric_handle = tier_retention[tier].db_metric_handle; qm->tiers[tier].db_first_time_s = tier_retention[tier].db_first_time_s; qm->tiers[tier].db_last_time_s = tier_retention[tier].db_last_time_s; @@ -341,9 +341,9 @@ static bool query_metric_add(QUERY_TARGET_LOCALS *qtl, QUERY_NODE *qn, QUERY_CON } // cleanup anything we allocated to the retention we will not use - for(size_t tier = 0; tier < rrdb.storage_tiers ;tier++) { + for(size_t tier = 0; tier < storage_tiers ;tier++) { if (tier_retention[tier].db_metric_handle) - storage_engine_metric_release(tier_retention[tier].storage_engine_id, tier_retention[tier].db_metric_handle); + tier_retention[tier].eng->api.metric_release(tier_retention[tier].db_metric_handle); } return false; diff --git a/database/contexts/rrdcontext.c b/database/contexts/rrdcontext.c index fe52a0f6ae..8538d17f28 100644 --- a/database/contexts/rrdcontext.c +++ b/database/contexts/rrdcontext.c @@ -199,8 +199,25 @@ int rrdcontext_foreach_instance_with_rrdset_in_context(RRDHOST *host, const char // ACLK interface static bool rrdhost_check_our_claim_id(const char *claim_id) { - if(!rrdb.localhost->aclk_state.claimed_id) return false; - return (strcasecmp(claim_id, rrdb.localhost->aclk_state.claimed_id) == 0) ? true : false; + if(!localhost->aclk_state.claimed_id) return false; + return (strcasecmp(claim_id, localhost->aclk_state.claimed_id) == 0) ? true : false; +} + +static RRDHOST *rrdhost_find_by_node_id(const char *node_id) { + uuid_t uuid; + if (uuid_parse(node_id, uuid)) + return NULL; + + RRDHOST *host = NULL; + dfe_start_read(rrdhost_root_index, host) { + if(!host->node_id) continue; + + if(uuid_memcmp(&uuid, host->node_id) == 0) + break; + } + dfe_done(host); + + return host; } void rrdcontext_hub_checkpoint_command(void *ptr) { @@ -209,7 +226,7 @@ void rrdcontext_hub_checkpoint_command(void *ptr) { if(!rrdhost_check_our_claim_id(cmd->claim_id)) { netdata_log_error("RRDCONTEXT: received checkpoint command for claim_id '%s', node id '%s', but this is not our claim id. Ours '%s', received '%s'. Ignoring command.", cmd->claim_id, cmd->node_id, - rrdb.localhost->aclk_state.claimed_id ? rrdb.localhost->aclk_state.claimed_id : "NOT SET", + localhost->aclk_state.claimed_id?localhost->aclk_state.claimed_id:"NOT SET", cmd->claim_id); return; @@ -271,7 +288,7 @@ void rrdcontext_hub_stop_streaming_command(void *ptr) { if(!rrdhost_check_our_claim_id(cmd->claim_id)) { netdata_log_error("RRDCONTEXT: received stop streaming command for claim_id '%s', node id '%s', but this is not our claim id. Ours '%s', received '%s'. Ignoring command.", cmd->claim_id, cmd->node_id, - rrdb.localhost->aclk_state.claimed_id ? rrdb.localhost->aclk_state.claimed_id : "NOT SET", + localhost->aclk_state.claimed_id?localhost->aclk_state.claimed_id:"NOT SET", cmd->claim_id); return; diff --git a/database/contexts/rrdcontext.h b/database/contexts/rrdcontext.h index 7c0c156737..0bcdb68ded 100644 --- a/database/contexts/rrdcontext.h +++ b/database/contexts/rrdcontext.h @@ -578,7 +578,7 @@ static inline const char *query_metric_name(QUERY_TARGET *qt, QUERY_METRIC *qm) return rrdmetric_acquired_name(qd->rma); } -STORAGE_ENGINE_ID query_metric_storage_engine(QUERY_TARGET *qt, QUERY_METRIC *qm, size_t tier); +struct storage_engine *query_metric_storage_engine(QUERY_TARGET *qt, QUERY_METRIC *qm, size_t tier); STRING *query_instance_id_fqdn(QUERY_INSTANCE *qi, size_t version); STRING *query_instance_name_fqdn(QUERY_INSTANCE *qi, size_t version); diff --git a/database/contexts/worker.c b/database/contexts/worker.c index e145c1093f..9d7c18863e 100644 --- a/database/contexts/worker.c +++ b/database/contexts/worker.c @@ -216,7 +216,7 @@ void rrdcontext_recalculate_host_retention(RRDHOST *host, RRD_FLAGS reason, bool static void rrdcontext_recalculate_retention_all_hosts(void) { rrdcontext_next_db_rotation_ut = 0; RRDHOST *host; - dfe_start_reentrant(rrdb.rrdhost_root_index, host) { + dfe_start_reentrant(rrdhost_root_index, host) { worker_is_busy(WORKER_JOB_RETENTION); rrdcontext_recalculate_host_retention(host, RRD_FLAG_UPDATE_REASON_DB_ROTATION, true); } @@ -235,9 +235,11 @@ bool rrdmetric_update_retention(RRDMETRIC *rm) { } else { RRDHOST *rrdhost = rm->ri->rc->rrdhost; - for (size_t tier = 0; tier < rrdb.storage_tiers; tier++) { + for (size_t tier = 0; tier < storage_tiers; tier++) { + STORAGE_ENGINE *eng = rrdhost->db[tier].eng; + time_t first_time_t, last_time_t; - if (storage_engine_metric_retention(rrdhost->db[tier].id, rrdhost->db[tier].instance, &rm->uuid, &first_time_t, &last_time_t)) { + if (eng->api.metric_retention_by_uuid(rrdhost->db[tier].instance, &rm->uuid, &first_time_t, &last_time_t)) { if (first_time_t < min_first_time_t) min_first_time_t = first_time_t; @@ -434,7 +436,7 @@ static void rrdcontext_garbage_collect_single_host(RRDHOST *host, bool worker_jo static void rrdcontext_garbage_collect_for_all_hosts(void) { RRDHOST *host; - dfe_start_reentrant(rrdb.rrdhost_root_index, host) { + dfe_start_reentrant(rrdhost_root_index, host) { rrdcontext_garbage_collect_single_host(host, true); } dfe_done(host); @@ -1109,7 +1111,7 @@ void *rrdcontext_main(void *ptr) { size_t pp_queued_contexts_for_all_hosts = 0; RRDHOST *host; - dfe_start_reentrant(rrdb.rrdhost_root_index, host) { + dfe_start_reentrant(rrdhost_root_index, host) { if(unlikely(!service_running(SERVICE_CONTEXT))) break; worker_is_busy(WORKER_JOB_HOSTS); diff --git a/database/engine/cache.c b/database/engine/cache.c index dbcd00ec31..7a9ccf8d1b 100644 --- a/database/engine/cache.c +++ b/database/engine/cache.c @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - #include "cache.h" /* STATES AND TRANSITIONS diff --git a/database/engine/cache.h b/database/engine/cache.h index 3e440ca83d..1486fdc166 100644 --- a/database/engine/cache.h +++ b/database/engine/cache.h @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - #ifndef DBENGINE_CACHE_H #define DBENGINE_CACHE_H diff --git a/database/engine/datafile.c b/database/engine/datafile.c index dd3461e084..d5c1285be1 100644 --- a/database/engine/datafile.c +++ b/database/engine/datafile.c @@ -250,7 +250,7 @@ int create_data_file(struct rrdengine_datafile *datafile) char path[RRDENG_PATH_MAX]; generate_datafilepath(datafile, path, sizeof(path)); - fd = open_file_for_io(path, O_CREAT | O_RDWR | O_TRUNC, &file, rrdb.use_direct_io); + fd = open_file_for_io(path, O_CREAT | O_RDWR | O_TRUNC, &file, use_direct_io); if (fd < 0) { ctx_fs_error(ctx); return fd; @@ -333,7 +333,7 @@ static int load_data_file(struct rrdengine_datafile *datafile) char path[RRDENG_PATH_MAX]; generate_datafilepath(datafile, path, sizeof(path)); - fd = open_file_for_io(path, O_RDWR, &file, rrdb.use_direct_io); + fd = open_file_for_io(path, O_RDWR, &file, use_direct_io); if (fd < 0) { ctx_fs_error(ctx); return fd; diff --git a/database/engine/journalfile.c b/database/engine/journalfile.c index aacfb0b5f0..abb9d2eb95 100644 --- a/database/engine/journalfile.c +++ b/database/engine/journalfile.c @@ -296,8 +296,8 @@ static bool journalfile_v2_mounted_data_unmount(struct rrdengine_journalfile *jo void journalfile_v2_data_unmount_cleanup(time_t now_s) { // DO NOT WAIT ON ANY LOCK!!! - for (size_t tier = 0; tier < rrdb.storage_tiers; tier++) { - struct rrdengine_instance *ctx = (struct rrdengine_instance *) rrdb.multidb_ctx[tier]; + for(size_t tier = 0; tier < (size_t)storage_tiers ;tier++) { + struct rrdengine_instance *ctx = multidb_ctx[tier]; if(!ctx) continue; struct rrdengine_datafile *datafile; @@ -577,7 +577,7 @@ int journalfile_create(struct rrdengine_journalfile *journalfile, struct rrdengi char path[RRDENG_PATH_MAX]; journalfile_v1_generate_path(datafile, path, sizeof(path)); - fd = open_file_for_io(path, O_CREAT | O_RDWR | O_TRUNC, &file, rrdb.use_direct_io); + fd = open_file_for_io(path, O_CREAT | O_RDWR | O_TRUNC, &file, use_direct_io); if (fd < 0) { ctx_fs_error(ctx); return fd; @@ -917,7 +917,7 @@ static int journalfile_v2_validate(void *data_start, size_t journal_v2_file_size rc = journalfile_check_v2_extent_list(data_start, journal_v2_file_size); if (rc) return 1; - if (!rrdb.db_engine_journal_check) + if (!db_engine_journal_check) return 0; rc = journalfile_check_v2_metric_list(data_start, journal_v2_file_size); @@ -1115,7 +1115,7 @@ int journalfile_v2_load(struct rrdengine_instance *ctx, struct rrdengine_journal // Initialize the journal file to be able to access the data - if (!rrdb.db_engine_journal_check) + if (!db_engine_journal_check) journalfile->v2.flags |= JOURNALFILE_FLAG_METRIC_CRC_CHECK; journalfile_v2_data_set(journalfile, fd, data_start, journal_v2_file_size); @@ -1501,7 +1501,7 @@ int journalfile_load(struct rrdengine_instance *ctx, struct rrdengine_journalfil journalfile_v1_generate_path(datafile, path, sizeof(path)); - fd = open_file_for_io(path, O_RDWR, &file, rrdb.use_direct_io); + fd = open_file_for_io(path, O_RDWR, &file, use_direct_io); if (fd < 0) { ctx_fs_error(ctx); diff --git a/database/engine/metric.c b/database/engine/metric.c index 1187941a2f..0b248c09b5 100644 --- a/database/engine/metric.c +++ b/database/engine/metric.c @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - #include "metric.h" typedef int32_t REFCOUNT; diff --git a/database/engine/metric.h b/database/engine/metric.h index c55800f051..5d5ebd7b13 100644 --- a/database/engine/metric.h +++ b/database/engine/metric.h @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - #ifndef DBENGINE_METRIC_H #define DBENGINE_METRIC_H diff --git a/database/engine/pagecache.c b/database/engine/pagecache.c index 8c765a2177..c608c32700 100644 --- a/database/engine/pagecache.c +++ b/database/engine/pagecache.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later +#define NETDATA_RRD_INTERNALS #include "rrdengine.h" @@ -231,7 +232,7 @@ static size_t get_page_list_from_pgc(PGC *cache, METRIC *metric, struct rrdengin time_t dt_s = mrg_metric_get_update_every_s(main_mrg, metric); if(!dt_s) - dt_s = rrdb.default_update_every; + dt_s = default_rrd_update_every; time_t previous_page_end_time_s = now_s - dt_s; bool first = true; @@ -422,7 +423,7 @@ static size_t list_has_time_gaps( time_t now_s = wanted_start_time_s; time_t dt_s = mrg_metric_get_update_every_s(main_mrg, metric); if(!dt_s) - dt_s = rrdb.default_update_every; + dt_s = default_rrd_update_every; size_t pages_pass2 = 0, pages_pass3 = 0; while((pd = pdc_find_page_for_time( @@ -1084,7 +1085,7 @ |