diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2020-02-05 20:13:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-05 20:13:08 +0000 |
commit | d9f977b864a8abc2213201817a93a041c30d17b4 (patch) | |
tree | b998fefd6408fb658001ffa4f521beac02fd04df /database | |
parent | 694b960620f5ea164c9a8dd2a37cd680f9a48fac (diff) |
Stream with version (#7851)
* stream_forward: Fix protocol
This commit brings the necessary fixes to the protocol
* stream_forward: Fix old slave support
This commit fixes the communication with old versions of Netdata
* stream_forward: Remove declaration
There was a wrong declaration inside a block, so I am removing it
* stream_forward: USe version
This commit brings the use of version instead flags to stream
* stream_forward: Remove variable
This commit removes useless variable from hand shake
* stream_forward: Change message
Change the message setting the protocol version on it
* stream_forward: Fix version number
* stream_forward: readable definition
The definition and the variables were using the same data type, but with different declaration,
this commit fixes this.
* stream_forward: Set master version inside message
This commit updates the message used that there was a successfull connection with master
* stream_forward: FIx wrong version
This commit fixes the multiple set for stream version
* stream_forward: Reorganize code
This commit reorganizes code to speed up the processing
* stream_forward: Adjust code
This commit removes an unecessary else
* stream_forward: Brings old structure
This commits returns a previous necessary to the code
* stream_forward: fix error report
This commit fixes the error report that was happening when the stream version does not match
* stream_forward: Fixes msg and remove unecessary call
Diffstat (limited to 'database')
-rw-r--r-- | database/rrd.h | 1 | ||||
-rw-r--r-- | database/rrdhost.c | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/database/rrd.h b/database/rrd.h index b873a5124d..f569a09d53 100644 --- a/database/rrd.h +++ b/database/rrd.h @@ -702,6 +702,7 @@ struct rrdhost { int rrdpush_sender_pipe[2]; // collector to sender thread signaling BUFFER *rrdpush_sender_buffer; // collector fills it, sender sends it + uint32_t stream_version; //Set the current version of the stream. // ------------------------------------------------------------------------ // streaming of data from remote hosts - rrdpush diff --git a/database/rrdhost.c b/database/rrdhost.c index abbd3193b9..6a11fc9020 100644 --- a/database/rrdhost.c +++ b/database/rrdhost.c @@ -147,6 +147,8 @@ RRDHOST *rrdhost_create(const char *hostname, host->rrdpush_sender_pipe[0] = -1; host->rrdpush_sender_pipe[1] = -1; host->rrdpush_sender_socket = -1; + + host->stream_version = STREAMING_PROTOCOL_CURRENT_VERSION; #ifdef ENABLE_HTTPS host->ssl.conn = NULL; host->ssl.flags = NETDATA_SSL_START; @@ -405,6 +407,7 @@ RRDHOST *rrdhost_find_or_create( } else { host->health_enabled = health_enabled; + host->stream_version = STREAMING_PROTOCOL_CURRENT_VERSION; if(strcmp(host->hostname, hostname) != 0) { info("Host '%s' has been renamed to '%s'. If this is not intentional it may mean multiple hosts are using the same machine_guid.", host->hostname, hostname); @@ -1309,7 +1312,9 @@ restart_after_removal: int rrdhost_set_system_info_variable(struct rrdhost_system_info *system_info, char *name, char *value) { int res = 0; - if(!strcmp(name, "NETDATA_CONTAINER_OS_NAME")){ + if (!strcmp(name, "NETDATA_PROTOCOL_VERSION")) + return res; + else if(!strcmp(name, "NETDATA_CONTAINER_OS_NAME")){ freez(system_info->container_os_name); system_info->container_os_name = strdupz(value); } |