@cryptotaxi247 / netdata-1 / commits / a4562ebe8

Fix dbengine dirty page flushing warning (#7469)

Markos Fountoulakis committed Dec 7, 2019 at 22:14 UTC a4562ebe89f5fa700198646305180ad536dfdf69
1 file changed +4 -4
database/engine/rrdengineapi.c
+4 -4
@@ -628,13 +628,13 @@ void rrdeng_commit_page(struct rrdengine_instance *ctx, struct rrdeng_page_descr
628 nr_committed_pages = ++pg_cache->committed_page_index.nr_committed_pages;
629 uv_rwlock_wrunlock(&pg_cache->committed_page_index.lock);
630
631 - if (nr_committed_pages >= (pg_cache_hard_limit(ctx) - (unsigned long)ctx->stats.metric_API_producers) / 2) {
631 + if (nr_committed_pages >= (ctx->max_cache_pages) / 2 + (unsigned long)ctx->stats.metric_API_producers) {
632 /* 50% of pages have not been committed yet */
633 if (0 == (unsigned long)ctx->stats.flushing_errors) {
634 /* only print the first time */
635 - error("Failed to flush quickly enough in dbengine instance \"%s\""
636 - ". Metric data will not be stored in the database"
637 - ", please reduce disk load or use a faster disk.", ctx->dbfiles_path);
635 + error("Failed to flush dirty buffers quickly enough in dbengine instance \"%s\"."
636 + "Metric data at risk of not being stored in the database, "
637 + "please reduce disk load or use a faster disk.", ctx->dbfiles_path);
638 }
639 rrd_stat_atomic_add(&ctx->stats.flushing_errors, 1);
640 rrd_stat_atomic_add(&global_flushing_errors, 1);