]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
Read the last timestamp from the RRD file, instead of setting it to zero. (#744)
authorThilo Bangert <bangert@users.noreply.github.com>
Tue, 4 Oct 2016 23:33:50 +0000 (01:33 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Tue, 4 Oct 2016 23:33:50 +0000 (18:33 -0500)
commit36fcb9c37a744834438c02611a4d772c7c5625d4
tree3d08ca49484144c705a3326f8473dab20495a86c
parentc871789f4ed0513a2f4eeb561e1657d041a9fd3e
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).

RRD  ----------------------|
RRDcached         |------------------| <- Flush
                           |---------| <- Dataloss

With this patch, the initial updates, that overlap with data in the RRD
file will fail indivdually (at submission time).

RRD  ----------------------|
RRDcached         |xxxxxxxx----------| <- Flush
src/rrd_daemon.c