Do not fail agent if DBENGINE is not available and memory mode is set to dbengine (#11207)

Use memory mode RAM instead
This commit is contained in:
Stelios Fragkakis 2021-06-01 13:00:30 +03:00 committed by GitHub
parent c851ea0ada
commit baa5399126
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -542,7 +542,6 @@ static void get_netdata_configured_variables() {
// get default memory mode for the database
default_rrd_memory_mode = rrd_memory_mode_id(config_get(CONFIG_SECTION_GLOBAL, "memory mode", rrd_memory_mode_name(default_rrd_memory_mode)));
#ifdef ENABLE_DBENGINE
// ------------------------------------------------------------------------
// get default Database Engine page cache size in MiB
@ -567,7 +566,11 @@ static void get_netdata_configured_variables() {
error("Invalid multidb disk space %d given. Defaulting to %d.", default_multidb_disk_quota_mb, default_rrdeng_disk_quota_mb);
default_multidb_disk_quota_mb = default_rrdeng_disk_quota_mb;
}
#else
if (default_rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE) {
error_report("RRD_MEMORY_MODE_DBENGINE is not supported in this platform. The agent will use memory mode ram instead.");
default_rrd_memory_mode = RRD_MEMORY_MODE_RAM;
}
#endif
// ------------------------------------------------------------------------

View File

@ -656,7 +656,7 @@ int rrd_init(char *hostname, struct rrdhost_system_info *system_info) {
if (unlikely(sql_init_database())) {
if (default_rrd_memory_mode == RRD_MEMORY_MODE_DBENGINE)
return 1;
fatal("Failed to initialize SQLite");
info("Skipping SQLITE metadata initialization since memory mode is not db engine");
}
@ -709,7 +709,7 @@ int rrd_init(char *hostname, struct rrdhost_system_info *system_info) {
rrdhost_free(localhost);
localhost = NULL;
rrd_unlock();
return 1;
fatal("Failed to initialize dbengine");
}
#endif
rrd_unlock();