summaryrefslogtreecommitdiffstats
path: root/database/engine/pdc.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:08 +0000
commit81581f9719bc56f01d5aa08952671d65fda9867a (patch)
tree0f5c6b6138bf169c23c9d24b1fc0a3521385cb18 /database/engine/pdc.c
parentReleasing debian version 1.38.1-1. (diff)
downloadnetdata-81581f9719bc56f01d5aa08952671d65fda9867a.tar.xz
netdata-81581f9719bc56f01d5aa08952671d65fda9867a.zip
Merging upstream version 1.39.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'database/engine/pdc.c')
-rw-r--r--database/engine/pdc.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/database/engine/pdc.c b/database/engine/pdc.c
index 8b8e71958..42fb2f6de 100644
--- a/database/engine/pdc.c
+++ b/database/engine/pdc.c
@@ -692,8 +692,9 @@ VALIDATED_PAGE_DESCRIPTOR validate_page(
vd.page_length > RRDENG_BLOCK_SIZE ||
vd.start_time_s > vd.end_time_s ||
(now_s && vd.end_time_s > now_s) ||
- vd.start_time_s == 0 ||
- vd.end_time_s == 0 ||
+ vd.start_time_s <= 0 ||
+ vd.end_time_s <= 0 ||
+ vd.update_every_s < 0 ||
(vd.start_time_s == vd.end_time_s && vd.entries > 1) ||
(vd.update_every_s == 0 && vd.entries > 1)
)
@@ -835,7 +836,7 @@ static void epdl_extent_loading_error_log(struct rrdengine_instance *ctx, EPDL *
uuid_unparse_lower(descr->uuid, uuid);
used_descr = true;
}
- else if (epdl) {
+ else {
struct page_details *pd = NULL;
Word_t start = 0;
@@ -855,7 +856,7 @@ static void epdl_extent_loading_error_log(struct rrdengine_instance *ctx, EPDL *
}
}
- if(!used_epdl && !used_descr && epdl && epdl->pdc) {
+ if(!used_epdl && !used_descr && epdl->pdc) {
start_time_s = epdl->pdc->start_time_s;
end_time_s = epdl->pdc->end_time_s;
}
@@ -1059,7 +1060,7 @@ static bool epdl_populate_pages_from_extent_data(
.metric_id = metric_id,
.start_time_s = vd.start_time_s,
.end_time_s = vd.end_time_s,
- .update_every_s = vd.update_every_s,
+ .update_every_s = (uint32_t) vd.update_every_s,
.size = (size_t) ((page_data == DBENGINE_EMPTY_PAGE) ? 0 : vd.page_length),
.data = page_data
};
@@ -1150,6 +1151,9 @@ static inline void datafile_extent_read_free(void *buffer) {
}
void epdl_find_extent_and_populate_pages(struct rrdengine_instance *ctx, EPDL *epdl, bool worker) {
+ if(worker)
+ worker_is_busy(UV_EVENT_DBENGINE_EXTENT_CACHE_LOOKUP);
+
size_t *statistics_counter = NULL;
PDC_PAGE_STATUS not_loaded_pages_tag = 0, loaded_pages_tag = 0;
@@ -1172,9 +1176,6 @@ void epdl_find_extent_and_populate_pages(struct rrdengine_instance *ctx, EPDL *e
goto cleanup;
}
- if(worker)
- worker_is_busy(UV_EVENT_DBENGINE_EXTENT_CACHE_LOOKUP);
-
bool extent_found_in_cache = false;
void *extent_compressed_data = NULL;