Bug#1002977: rrdtool: "rrdtool fetch" outputs values even for CFs that are not stored

2022-01-01 Thread Vincent Lefevre
On 2022-01-02 04:17:35 +0100, Vincent Lefevre wrote:
> But
> 
>   rrdtool fetch cpuload.rrd MIN -s -108
> 
> also outputs values. Selected step is 300, and most values
> (for the oldest timestamps) are NaN. Instead, it should fail.

In case you're wondering why I try to read values associated with a CF
that has not been declared with "rrdtool create", this is because this
is done via a Perl script on several .rrd files, via the RRDs Perl
module. For some of these files, MIN has been declared, but not all of
them, and the script doesn't know which CFs are used. So it tries all
of them. If a CF isn't used, it expects an error so that it can skip
it instead of getting unexpected results.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



Bug#1002977: rrdtool: "rrdtool fetch" outputs values even for CFs that are not stored

2022-01-01 Thread Vincent Lefevre
Package: rrdtool
Version: 1.7.2-3+b7
Severity: normal

I have created cpuload.rrd with

rrdtool create cpuload.rrd \
  DS:cpuload:GAUGE:600:0:U \
  RRA:AVERAGE:0.5:1:600 \
  RRA:AVERAGE:0.5:6:600 \
  RRA:AVERAGE:0.5:24:600 \
  RRA:AVERAGE:0.5:288:600 \
  RRA:MAX:0.5:1:600 \
  RRA:MAX:0.5:6:600 \
  RRA:MAX:0.5:24:600 \
  RRA:MAX:0.5:288:600

So there's AVERAGE and MAX, but not MIN.

As expected,

  rrdtool fetch cpuload.rrd AVERAGE -s -108

and

  rrdtool fetch cpuload.rrd MAX -s -108

both output values with step 1800.

But

  rrdtool fetch cpuload.rrd MIN -s -108

also outputs values. Selected step is 300, and most values
(for the oldest timestamps) are NaN. Instead, it should fail.

This is a regression.

-- System Information:
Debian Release: 11.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-10-amd64 (SMP w/1 CPU thread)
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages rrdtool depends on:
ii  libc6 2.31-13+deb11u2
ii  libglib2.0-0  2.66.8-1
ii  librrd8   1.7.2-3+b7

rrdtool recommends no packages.

Versions of packages rrdtool suggests:
ii  librrds-perl  1.7.2-3+b7

-- no debconf information

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)