Fix transition from archived to active charts not generating alarms. (#9536)
Markos Fountoulakis committed
Jul 14, 2020 at 12:44 UTC
df57b89fafdffa7fd45aaf608c07b9a6717cc2ea
1 file changed
+2
-2
database/rrdset.c
+2
-2
@@ -534,9 +534,9 @@ RRDSET *rrdset_create_custom(
534
char fullid[RRD_ID_LENGTH_MAX + 1];
535
snprintfz(fullid, RRD_ID_LENGTH_MAX, "%s.%s", type, id);
536
537
+ int changed_from_archived_to_active = 0;
538
RRDSET *st = rrdset_find_on_create(host, fullid);
539
if (st) {
539
- int changed_from_archived_to_active = 0;
540
int mark_rebuild = 0;
541
rrdset_flag_set(st, RRDSET_FLAG_SYNC_CLOCK);
542
rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED);
@@ -670,7 +670,7 @@ RRDSET *rrdset_create_custom(
670
671
st = rrdset_find_on_create(host, fullid);
672
if(st) {
673
- if (!is_archived && rrdset_flag_check(st, RRDSET_FLAG_ARCHIVED)) {
673
+ if (changed_from_archived_to_active) {
674
rrdset_flag_clear(st, RRDSET_FLAG_ARCHIVED);
675
rrdsetvar_create(st, "last_collected_t", RRDVAR_TYPE_TIME_T, &st->last_collected_time.tv_sec, RRDVAR_OPTION_DEFAULT);
676
rrdsetvar_create(st, "collected_total_raw", RRDVAR_TYPE_TOTAL, &st->last_collected_total, RRDVAR_OPTION_DEFAULT);