summaryrefslogtreecommitdiffstats
path: root/streaming
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2020-07-28 15:04:39 +0300
committerGitHub <noreply@github.com>2020-07-28 15:04:39 +0300
commiteda12f579f97b123ef9b890b01528223a89a70aa (patch)
tree49fe4fd2adbf7fac9ef0f0e959d767ec4daa7849 /streaming
parent3d4314bc4ded8ce68385665754fb3b2134906422 (diff)
Implemented multihost database (#9556)
* Hard code a node for non-legacy multidb test Skip dbengine initialization for new incoming children Add code to switch to multidb ctx when accessing the dbengine * When a non-legacy streaming connection is detected, use the multidb metadata log context * Clear the superblock memory to avoid random data written in the metadata log * Activate the host detection during compaction Activate the host detection during metadata log chart updates Keep the host in the user object during replay of the HOST command * Add defaults for health / rrdpush on HOST metadata replay Check for legacy status on host creation by checking is_archived and if not conclusive, call is_legacy_child() Use defaults from the stream.conf * Count hosts only if not archived When host switches from archived to active update rrd_hosts_available Remove archived hosts from charts and info * Change parameter from "multidb disk space" to "dbengine multihost disk space" Remove unused variables Fix compilation error when dbengine is disabled Fix condition for machine_guid directory creation under cache_dir * Enable multidb disk space file creation. * Stop deleting dimensions when rotating archived metrics if the dimension is active in a different database engine. * Fix old bug in the code that confused obsolete hosts with orphan hosts. * Do not delete multi-host DB host files. * Discard dbengine state when a legacy memory mode instantiates to avoid inconsistencies. * Identify metadata that collide with non-dbengine memory mode hosts and ignore them. * Handle non-dbengine localhost with dbengine archived charts in localhost and streaming. * Ignore archived hosts in streaming. * Add documentation before merging to master. Co-authored-by: Markos Fountoulakis <markos.fountoulakis.senior@gmail.com>
Diffstat (limited to 'streaming')
-rw-r--r--streaming/README.md2
-rw-r--r--streaming/receiver.c19
-rw-r--r--streaming/rrdpush.c2
3 files changed, 3 insertions, 20 deletions
diff --git a/streaming/README.md b/streaming/README.md
index 6891692dae..39693b6819 100644
--- a/streaming/README.md
+++ b/streaming/README.md
@@ -189,7 +189,7 @@ them `/var/lib/netdata/registry/netdata.unique.id`). So, metrics for Netdata `A`
any number of other Netdata, will have the same `MACHINE_GUID`.
You can also use `default memory mode = dbengine` for an API key or `memory mode = dbengine` for
- a single host. The additional `page cache size` and `dbengine disk space` configuration options
+ a single host. The additional `page cache size` and `dbengine multihost disk space` configuration options
are inherited from the global Netdata configuration.
##### allow from
diff --git a/streaming/receiver.c b/streaming/receiver.c
index 73a296eecd..a7f66bede6 100644
--- a/streaming/receiver.c
+++ b/streaming/receiver.c
@@ -287,25 +287,6 @@ static int rrdpush_receive(struct receiver_state *rpt)
}
netdata_mutex_unlock(&rpt->host->receiver_lock);
}
- else rrdhost_update(rpt->host
- , rpt->hostname
- , rpt->registry_hostname
- , rpt->machine_guid
- , rpt->os
- , rpt->timezone
- , rpt->tags
- , rpt->program_name
- , rpt->program_version
- , rpt->update_every
- , history
- , mode
- , (unsigned int)(health_enabled != CONFIG_BOOLEAN_NO)
- , (unsigned int)(rrdpush_enabled && rrdpush_destination && *rrdpush_destination && rrdpush_api_key && *rrdpush_api_key)
- , rrdpush_destination
- , rrdpush_api_key
- , rrdpush_send_charts_matching
- , rpt->system_info);
-
int ssl = 0;
#ifdef ENABLE_HTTPS
diff --git a/streaming/rrdpush.c b/streaming/rrdpush.c
index a9f06f10ca..1731857f56 100644
--- a/streaming/rrdpush.c
+++ b/streaming/rrdpush.c
@@ -611,6 +611,8 @@ int rrdpush_receiver_thread_spawn(struct web_client *w, char *url) {
*/
struct receiver_state *rpt = callocz(1, sizeof(*rpt));
RRDHOST *host = rrdhost_find_by_guid(machine_guid, 0);
+ if (unlikely(host && rrdhost_flag_check(host, RRDHOST_FLAG_ARCHIVED))) /* Ignore archived hosts. */
+ host = NULL;
if (host) {
netdata_mutex_lock(&host->receiver_lock);
if (host->receiver != NULL) {