@cryptotaxi247 / netdata-1 / commits / 2b3e1d680

Fix compile without dbengine (#19930)

* Fix compile without dbengine * Fix compilation when using FSANITIZE_ADDRESS * Fix compilation warning when compiling without ENABLE_SENTRY

Stelios Fragkakis committed Mar 21, 2025 at 11:09 UTC 2b3e1d680fe32bd93a9e9efc751e3268336a50c8
4 files changed +12 -2
src/daemon/config/netdata-conf-backwards-compatibility.c
+2
@@ -244,7 +244,9 @@ void netdata_conf_backwards_compatibility(void) {
244 found_old_config = true;
245 }
246
247 +#ifdef ENABLE_DBENGINE
248 legacy_multihost_db_space = found_old_config;
249 +#endif
250
251 // ----------------------------------------------------------------------------------------------------------------
252
src/daemon/daemon-shutdown.c
+6 -1
@@ -23,6 +23,7 @@ void abort_on_fatal_enable(void) {
23 abort_on_fatal = true;
24 }
25
26 +#ifdef ENABLE_SENTRY
27 NEVER_INLINE
28 static bool shutdown_on_fatal(void) {
29 // keep this as a separate function, to have it logged like this in sentry
@@ -31,6 +32,7 @@ static bool shutdown_on_fatal(void) {
32 else
33 return false;
34 }
35 +#endif
36
37 void web_client_cache_destroy(void);
38
@@ -102,13 +104,14 @@ void cancel_main_threads(void) {
104 static_threads = NULL;
105 }
106
107 +#ifdef ENABLE_DBENGINE
108 static void *rrdeng_exit_background(void *ptr) {
109 struct rrdengine_instance *ctx = ptr;
110 rrdeng_exit(ctx);
111 return NULL;
112 }
113
111 -#ifdef ENABLE_DBENGINE
114 +
115 static void rrdeng_flush_everything_and_wait(bool wait_flush, bool wait_collectors, bool dirty_only) {
116 static size_t starting_size_to_flush = 0;
117
@@ -338,6 +341,7 @@ static void netdata_cleanup_and_exit(EXIT_REASON reason, bool abnormal, bool exi
341 fprintf(stderr, "WARNING: There are %zu dictionaries with references in them, that cannot be destroyed.\n",
342 dictionaries_referenced);
343
344 +#ifdef ENABLE_DBENGINE
345 // destroy the caches in reverse order (extent and open depend on main cache)
346 fprintf(stderr, "Destroying extent cache (PGC)...\n");
347 pgc_destroy(extent_cache, false);
@@ -351,6 +355,7 @@ static void netdata_cleanup_and_exit(EXIT_REASON reason, bool abnormal, bool exi
355 if(metrics_referenced)
356 fprintf(stderr, "WARNING: MRG had %zu metrics referenced.\n",
357 metrics_referenced);
358 +#endif
359
360 fprintf(stderr, "Destroying UUIDMap...\n");
361 size_t uuid_referenced = uuidmap_destroy();
src/daemon/pulse/pulse-daemon-memory.c
+2 -1
@@ -274,6 +274,7 @@ void pulse_daemon_memory_do(bool extended __maybe_unused) {
274
275 // ----------------------------------------------------------------------------------------------------------------
276
277 +#ifdef ENABLE_DBENGINE
278 OS_SYSTEM_MEMORY sm = os_system_memory(true);
279 if (OS_SYSTEM_MEMORY_OK(sm) && dbengine_out_of_memory_protection) {
280 static RRDSET *st_memory_available = NULL;
@@ -304,6 +305,6 @@ void pulse_daemon_memory_do(bool extended __maybe_unused) {
305
306 rrdset_done(st_memory_available);
307 }
307 -
308 +#endif
309 // ----------------------------------------------------------------------------------------------------------------
310 }
src/web/api/web_api_v1.c
+2
@@ -192,6 +192,7 @@ static struct web_api_command api_commands_v1[] = {
192 .callback = api_v1_aclk,
193 .allow_subpaths = 0
194 },
195 +#ifdef ENABLE_DBENGINE
196 {
197 // deprecated - use /api/v2/info
198 .api = "dbengine_stats",
@@ -201,6 +202,7 @@ static struct web_api_command api_commands_v1[] = {
202 .callback = api_v1_dbengine_stats,
203 .allow_subpaths = 0
204 },
205 +#endif
206 {
207 .api = "ml_info",
208 .hash = 0,