@cryptotaxi247 / netdata-1 / commits / 2d999d9ef

Re-store rrdvars on late dimensions (#15984)

Emmanuel Vasilakis committed Sep 18, 2023 at 13:22 UTC 2d999d9ef7a43b02eb9f65228ba106bd1e07ab98
3 files changed +4 -1
database/rrd.h
+2
@@ -709,6 +709,8 @@ typedef enum __attribute__ ((__packed__)) rrdset_flags {
709 RRDSET_FLAG_UPSTREAM_SEND_VARIABLES = (1 << 26), // a custom variable has been updated and needs to be exposed to parent
710
711 RRDSET_FLAG_COLLECTION_FINISHED = (1 << 27), // when set, data collection is not available for this chart
712 +
713 + RRDSET_FLAG_HAS_RRDCALC_LINKED = (1 << 28), // this chart has at least one rrdcal linked
714 } RRDSET_FLAGS;
715
716 #define rrdset_flag_check(st, flag) (__atomic_load_n(&((st)->flags), __ATOMIC_SEQ_CST) & (flag))
database/rrdcalc.c
+1
@@ -316,6 +316,7 @@ static void rrdcalc_link_to_rrdset(RRDSET *st, RRDCALC *rc) {
316
317 rc->ae = ae;
318 health_alarm_log_add_entry(host, ae);
319 + rrdset_flag_set(st, RRDSET_FLAG_HAS_RRDCALC_LINKED);
320 }
321
322 static void rrdcalc_unlink_from_rrdset(RRDCALC *rc, bool having_ll_wrlock) {
health/health.c
+1 -1
@@ -990,7 +990,7 @@ static void health_execute_delayed_initializations(RRDHOST *host) {
990 }
991 foreach_rrdcalctemplate_done(rt);
992
993 - if (health_variable_check(health_rrdvars, st, rd))
993 + if (health_variable_check(health_rrdvars, st, rd) || rrdset_flag_check(st, RRDSET_FLAG_HAS_RRDCALC_LINKED))
994 rrdvar_store_for_chart(host, st);
995 }
996 rrddim_foreach_done(rd);