From a1a4cb2314fea3b6786870d875c312909d32b76f Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Mon, 31 Oct 2022 14:50:19 +0200 Subject: do not free hosts if a change on db mode is not needed (#13912) --- database/rrdhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/rrdhost.c b/database/rrdhost.c index 3bde0ee178..5fc1021388 100644 --- a/database/rrdhost.c +++ b/database/rrdhost.c @@ -631,7 +631,7 @@ RRDHOST *rrdhost_find_or_create( rrd_wrlock(); RRDHOST *host = rrdhost_find_by_guid(guid); - if (unlikely(host && RRD_MEMORY_MODE_DBENGINE != mode && rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED))) { + if (unlikely(host && host->rrd_memory_mode != mode && rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED))) { /* If a legacy memory mode instantiates all dbengine state must be discarded to avoid inconsistencies */ error("Archived host '%s' has memory mode '%s', but the wanted one is '%s'. Discarding archived state.", rrdhost_hostname(host), rrd_memory_mode_name(host->rrd_memory_mode), rrd_memory_mode_name(mode)); -- cgit v1.2.3