@cryptotaxi247 / netdata-1 / commits / f1f87af88

Reject child when context is loading (#14960)

* Reject child when context is loading * Switch check position

Stelios Fragkakis committed Apr 25, 2023 at 17:55 UTC f1f87af884082580d4437397550883df21c13f27
1 file changed +4
database/rrdhost.c
+4
@@ -693,6 +693,10 @@ RRDHOST *rrdhost_find_or_create(
693
694 RRDHOST *host = rrdhost_find_by_guid(guid);
695 if (unlikely(host && host->rrd_memory_mode != mode && rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED))) {
696 +
697 + if (likely(!archived && rrdhost_flag_check(host, RRDHOST_FLAG_PENDING_CONTEXT_LOAD)))
698 + return host;
699 +
700 /* If a legacy memory mode instantiates all dbengine state must be discarded to avoid inconsistencies */
701 error("Archived host '%s' has memory mode '%s', but the wanted one is '%s'. Discarding archived state.",
702 rrdhost_hostname(host), rrd_memory_mode_name(host->rrd_memory_mode), rrd_memory_mode_name(mode));