@cryptotaxi247 / netdata-1 / commits / a1a4cb231

do not free hosts if a change on db mode is not needed (#13912)

Costa Tsaousis committed Oct 31, 2022 at 14:50 UTC a1a4cb2314fea3b6786870d875c312909d32b76f
1 file changed +1 -1
database/rrdhost.c
+1 -1
@@ -631,7 +631,7 @@ RRDHOST *rrdhost_find_or_create(
631
632 rrd_wrlock();
633 RRDHOST *host = rrdhost_find_by_guid(guid);
634 - if (unlikely(host && RRD_MEMORY_MODE_DBENGINE != mode && rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED))) {
634 + if (unlikely(host && host->rrd_memory_mode != mode && rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED))) {
635 /* If a legacy memory mode instantiates all dbengine state must be discarded to avoid inconsistencies */
636 error("Archived host '%s' has memory mode '%s', but the wanted one is '%s'. Discarding archived state.",
637 rrdhost_hostname(host), rrd_memory_mode_name(host->rrd_memory_mode), rrd_memory_mode_name(mode));