summaryrefslogtreecommitdiffstats
path: root/database/engine/pagecache.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-12-05 16:29:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-12-05 16:31:00 +0000
commit89b68730a8a23e3393f0fe9623ac6ec4480021a1 (patch)
tree2fdf1b5447ffd8bdd61e702ca183e814afdcb4fc /database/engine/pagecache.c
parentAdding upstream version 1.37.0. (diff)
downloadnetdata-89b68730a8a23e3393f0fe9623ac6ec4480021a1.tar.xz
netdata-89b68730a8a23e3393f0fe9623ac6ec4480021a1.zip
Adding upstream version 1.37.1.upstream/1.37.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'database/engine/pagecache.c')
-rw-r--r--database/engine/pagecache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/database/engine/pagecache.c b/database/engine/pagecache.c
index d65cb35a5..4f5da7084 100644
--- a/database/engine/pagecache.c
+++ b/database/engine/pagecache.c
@@ -524,6 +524,14 @@ uint8_t pg_cache_punch_hole(struct rrdengine_instance *ctx, struct rrdeng_page_d
}
rrdeng_page_descr_mutex_unlock(ctx, descr);
+ while (unlikely(pg_cache_descr->flags & RRD_PAGE_READ_PENDING)) {
+ error_limit_static_global_var(erl, 1, 0);
+ error_limit(&erl, "%s: Found page with READ PENDING, waiting for read to complete", __func__);
+ if (unlikely(debug_flags & D_RRDENGINE))
+ print_page_cache_descr(descr, "", true);
+ pg_cache_wait_event_unsafe(descr);
+ }
+
if (pg_cache_descr->flags & RRD_PAGE_POPULATED) {
/* only after locking can it be safely deleted from LRU */
pg_cache_replaceQ_delete(ctx, descr);
@@ -1196,7 +1204,6 @@ struct pg_cache_page_index *create_page_index(uuid_t *id, struct rrdengine_insta
page_index->refcount = 0;
page_index->writers = 0;
page_index->ctx = ctx;
- page_index->alignment = NULL;
page_index->latest_update_every_s = default_rrd_update_every;
return page_index;