summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2020-06-12 10:35:17 +0300
committerGitHub <noreply@github.com>2020-06-12 10:35:17 +0300
commit1bd8a255441de6056a0d51a7bb787f76b590ffb6 (patch)
tree5b0ae5ca07d19e2323e202e72ca15247409b0a2d /daemon
parent45747d3e47cde80589bf702c92ff9557fe8b7f7d (diff)
Add support for persistent metadata (#9324)
* Implemented collector metadata logging * Added persistent GUIDs for charts and dimensions * Added metadata log replay and automatic compaction * Added detection of charts with no active collector (archived) * Added new endpoint to report archived charts via `/api/v1/archivedcharts` * Added support for collector metadata update Co-authored-by: Markos Fountoulakis <44345837+mfundul@users.noreply.github.com>
Diffstat (limited to 'daemon')
-rw-r--r--daemon/common.h6
-rw-r--r--daemon/main.c6
-rw-r--r--daemon/unit_test.c6
3 files changed, 16 insertions, 2 deletions
diff --git a/daemon/common.h b/daemon/common.h
index 742ca4a766..f35c6a8828 100644
--- a/daemon/common.h
+++ b/daemon/common.h
@@ -68,9 +68,15 @@
// netdata agent cloud link
#include "aclk/agent_cloud_link.h"
+// global GUID map functions
+
// netdata agent spawn server
#include "spawn/spawn.h"
+#ifdef ENABLE_DBENGINE
+#include "database/engine/global_uuid_map/global_uuid_map.h"
+#endif
+
// the netdata deamon
#include "daemon.h"
#include "main.h"
diff --git a/daemon/main.c b/daemon/main.c
index dd556af640..2087d651ff 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -1400,6 +1400,9 @@ int main(int argc, char **argv) {
struct rrdhost_system_info *system_info = calloc(1, sizeof(struct rrdhost_system_info));
get_system_info(system_info);
+#ifdef ENABLE_DBENGINE
+ init_global_guid_map();
+#endif
if(rrd_init(netdata_configured_hostname, system_info))
fatal("Cannot initialize localhost instance with name '%s'.", netdata_configured_hostname);
@@ -1417,6 +1420,9 @@ int main(int argc, char **argv) {
// Load host labels
reload_host_labels();
+#ifdef ENABLE_DBENGINE
+ metalog_commit_update_host(localhost);
+#endif
// ------------------------------------------------------------------------
// spawn the threads
diff --git a/daemon/unit_test.c b/daemon/unit_test.c
index 323ae285a3..116fe7061d 100644
--- a/daemon/unit_test.c
+++ b/daemon/unit_test.c
@@ -1833,9 +1833,10 @@ int test_dbengine(void)
}
}
error_out:
- rrdeng_exit(host->rrdeng_ctx);
rrd_wrlock();
+ rrdeng_prepare_exit(host->rrdeng_ctx);
rrdhost_delete_charts(host);
+ rrdeng_exit(host->rrdeng_ctx);
rrd_unlock();
return errors;
@@ -2222,9 +2223,10 @@ void dbengine_stress_test(unsigned TEST_DURATION_SEC, unsigned DSET_CHARTS, unsi
freez(query_threads[i]);
}
freez(query_threads);
- rrdeng_exit(host->rrdeng_ctx);
rrd_wrlock();
+ rrdeng_prepare_exit(host->rrdeng_ctx);
rrdhost_delete_charts(host);
+ rrdeng_exit(host->rrdeng_ctx);
rrd_unlock();
}