@cryptotaxi247 / netdata-1 / commits / 919aac74a

Skip label cleanup during metadata processing (#19274)

Skip check for chart label cleanup during metadata update

Stelios Fragkakis committed Dec 23, 2024 at 15:51 UTC 919aac74ad42c588c2940ba054b2f10656254c9c
1 file changed -19
src/database/sqlite/sqlite_metadata.c
-19
@@ -837,24 +837,6 @@ static int chart_label_store_to_sql_callback(const char *name, const char *value
837 return 1;
838 }
839
840 -#define SQL_DELETE_CHART_LABEL "DELETE FROM chart_label WHERE chart_id = @chart_id"
841 -#define SQL_DELETE_CHART_LABEL_HISTORY "DELETE FROM chart_label WHERE date_created < %ld AND chart_id = @chart_id"
842 -
843 -static void clean_old_chart_labels(RRDSET *st)
844 -{
845 - char sql[512];
846 - time_t first_time_s = rrdset_first_entry_s(st);
847 -
848 - if (unlikely(!first_time_s))
849 - snprintfz(sql, sizeof(sql) - 1, SQL_DELETE_CHART_LABEL);
850 - else
851 - snprintfz(sql, sizeof(sql) - 1, SQL_DELETE_CHART_LABEL_HISTORY, first_time_s);
852 -
853 - int rc = exec_statement_with_uuid(sql, &st->chart_uuid);
854 - if (unlikely(rc))
855 - error_report("METADATA: 'host:%s' Failed to clean old labels for chart %s", rrdhost_hostname(st->rrdhost), rrdset_name(st));
856 -}
857 -
840 static int check_and_update_chart_labels(RRDSET *st, BUFFER *work_buffer, size_t *query_counter)
841 {
842 size_t old_version = st->rrdlabels_last_saved_version;
@@ -873,7 +855,6 @@ static int check_and_update_chart_labels(RRDSET *st, BUFFER *work_buffer, size_t
855 (*query_counter)++;
856 }
857
876 - clean_old_chart_labels(st);
858 return rc;
859 }
860