Sven Panne [Tue, 30 May 2017 07:19:04 +0000 (09:19 +0200)]
Fixed declaration and export of rrd_dump_opt_r.
The previous state of affairs regarding rrd_dump_opt_r was a bit
inconsistent: The dynamic library didn't export it, while the static one
did. So the right way to fix it will be exporting it in both variants,
because removing it from the static library would require a major version
change. Furthermore, rrd_dump_opt_r is mentioned in the documentation at
librrd.pod, so this is another hint for the fix.
In addition, a C prototype was wmissing, so GCC complained about it.
Sven Panne [Wed, 24 May 2017 13:18:54 +0000 (15:18 +0200)]
Added missing GLib thread initialization.
Older GLib versions (< 2.32, e.g. the ones shipped with CentOS 5 and 6,
SLES11, Debian 6) need an explicit initialization to make things
thread-safe, see:
RRDtools didn't do that, so you get random crashes in clients and the
rrdcached on those systems. Now we make sure that GLib is properly
initialized before calling into it.
make top_distdir="bxrrdtool-1.6.1" distdir="bxrrdtool-1.6.1" dist-hook
make[2]: Entering directory '/home/vficet/src/rrdtool-1.x'
cd bxrrdtool-1.6.1 && /usr/bin/perl -i -p -e 's/^\1ERSION.+/\1ERSION='1.6002';/' bindings/perl-*/*.pm
Reference to nonexistent group in regex; marked by <-- HERE in m/^\1 <-- HERE ERSION.+/ at -e line 1.
Makefile:933: recipe for target 'dist-hook' failed
Tomas Vestelind [Wed, 1 Mar 2017 15:15:53 +0000 (16:15 +0100)]
use systemd macros for rrdcached in rpm spec file
I've added:
* a variable to control whether or not to build for systemd
* systemd-provided macros in the RPM spec-file according what Fedora
recommends.
Signed-off-by: Tomas Vestelind <tomas.vestelind@gmail.com>
Tomas Vestelind [Wed, 25 Jan 2017 17:30:27 +0000 (18:30 +0100)]
restart rrdcached on upgrade, start and stop in install/uninstall (#764)
* restart rrdcached on upgrade, start and stop in install/uninstall
Start rrdcached and enable autostart when installing
Restart rrdcached and enable autostart when upgrading
Stop rrdcached and disable autostart when uninstalling
Catch non-zero return codes and return 0 in scriptlets
Signed-off-by: Tomas Vestelind <tomas.vestelind@gmail.com>
* enable and restart on both install and upgrade just before finishing the rpm installation
Signed-off-by: Tomas Vestelind <tomas.vestelind@gmail.com>
Marek Schimara [Mon, 24 Oct 2016 11:11:24 +0000 (13:11 +0200)]
src/rrd_daemon.c: fix incorrect line number reporting by rrdcached in fetch
Example of error:
rrdtool fetch --daemon 127.0.0.1:42218 <path to>.rrd --start -5min LAST
ERROR: rrdc_fetch: Got 34 lines, expected 37
While the same, without '--daemon <address>' works fine.
The bug manifests itself when the last element of line to write falls
within the last 10% of the length of 'char linebuf[1024]', ie between
922 and 1023 bytes; in that case the '\n' at the end of the line is
not written, and so not seen by count_lines(), wrong number of lines
given in the daemon's response -> 'rrdtool fetch' errors out.
Havard Eidnes [Tue, 18 Oct 2016 21:12:29 +0000 (23:12 +0200)]
Fix a signedness/unsignedness conversion bug in the expression
calculating "now" before printout of the timestamp. Negative values
are first cast to unsigned, it seems, causing overflow.
Sebastian Harl [Mon, 17 Oct 2016 07:40:22 +0000 (09:40 +0200)]
Improve the RRD client API (#742)
* RRD client: Add an interface allowing for multiple client connections.
Add a client object which resembles a persistent connection to a server.
Multiple such objects may be used in parallel.
The old, "simple" interface is a wrapper around the new interface now, using
a default client connection. As before, this can only be used for one
connection.
Thilo Bangert [Tue, 4 Oct 2016 23:33:50 +0000 (01:33 +0200)]
Read the last timestamp from the RRD file, instead of setting it to zero. (#744)
This fixes a dataloss problem when trying to insert old data. rrdcached
will accept the data at first, but then fail the whole batch when trying
to flush the data to disk.
The last timestamp is initially set to 0, and later updated to the
timestamp of the first update. However, if the RRD file already contains
newer data, fails later on. And since RRD cache writes all updates
in one go, the whole batch of samples fails and is discarded (even though,
just the first few updates are too old).
By reading in the last timestamp from the RRD file, we already fail
correctly on the individual update commands (ie. on the protocol layer).
Marek Schimara [Wed, 7 Sep 2016 12:24:21 +0000 (14:24 +0200)]
src/rrd_list.c: fix local directory listing when connection to rrdcached fails
Without this fix, when the remote rrdcached cannot be reached
and a path that exists on the local machine (such as '/') is
asked for, 'list' returns 'ls' of the local path.
Example of erroneous output:
$ rrdtool list -d rrdcached-host:42222 /
Error connecting to rrdcached: Unable to connect to rrdcached: Connection refused
var
storage
lib
sysroot
rules.d
lib64
backup
opt
bin
sbin
boot
proc
usr
dev
sys
srv
mnt
run
etc
media
tmp
home
root
ERROR: Unable to connect to rrdcached: Connection refused
rrd_info.c: In function 'rrd_info_r':
rrd_info.c:178:16: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
info.u_str = filename;
^
rrd_daemon: Log strerror(errno) when rrd_mkdir_p() fails
Log strerror(errno) when rrd_mkdir_p() fails in order to know what went wrong
from a client application perspective.
In this particular case, rrd_mkdir_p failed due to the lack of inodes.
Sending a message with 'No Space left on device' allowed the application
to limit the logs in the code in charge of handling the
RRDTOOL_FILESYSTEM_FULL error, rather than flooding the logs with all
the failed queries.
rrd_utils: Fix broken recusive directory creation in multithreaded context
Multithreaded applications can issue CREATE commands simultaneously
from several threads. Such commands may require to create directories
from the same root path.