diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2022-06-17 12:28:28 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 12:28:28 +0300 |
commit | b53a30ae5380b8af42634df26a78aae7854f350d (patch) | |
tree | d774364218a3142814deeeac5c21ff714d94e803 /web | |
parent | 7ebbf65e93b95e72d29db30ba1f0af83b5c8c0cc (diff) |
Fix data query on stale chart (#13159)
* Fix data query on stale chart
* Remove more checks vs the last timestamp of a point collected
Diffstat (limited to 'web')
-rw-r--r-- | web/api/queries/query.c | 47 |
1 files changed, 3 insertions, 44 deletions
diff --git a/web/api/queries/query.c b/web/api/queries/query.c index 778a7eb6b0..5250c1aad8 100644 --- a/web/api/queries/query.c +++ b/web/api/queries/query.c @@ -893,6 +893,8 @@ static RRDR *rrd2rrdr_fixedstep( , struct context_param *context_param_list , int timeout ) { + UNUSED(last_entry_t); + int aligned = !(options & RRDR_OPTION_NOT_ALIGNED); RRDDIM *temp_rd = context_param_list ? context_param_list->rd : NULL; @@ -973,13 +975,6 @@ static RRDR *rrd2rrdr_fixedstep( // we align the request on requested_before time_t before_wanted = before_requested; - if(likely(before_wanted > last_entry_t)) { - #ifdef NETDATA_INTERNAL_CHECKS - error("INTERNAL ERROR: rrd2rrdr() on %s, before_wanted is after db max", st->name); - #endif - - before_wanted = last_entry_t - (last_entry_t % ( ((aligned)?group:1) * update_every )); - } // we need to estimate the number of points, for having // an integer number of values per point @@ -1027,23 +1022,9 @@ static RRDR *rrd2rrdr_fixedstep( if(after_wanted < first_entry_t) error("INTERNAL CHECK: after_wanted %u is too small, minimum %u", (uint32_t)after_wanted, (uint32_t)first_entry_t); - if(after_wanted > last_entry_t) - error("INTERNAL CHECK: after_wanted %u is too big, maximum %u", (uint32_t)after_wanted, (uint32_t)last_entry_t); - if(before_wanted < first_entry_t) error("INTERNAL CHECK: before_wanted %u is too small, minimum %u", (uint32_t)before_wanted, (uint32_t)first_entry_t); - if(before_wanted > last_entry_t) - error("INTERNAL CHECK: before_wanted %u is too big, maximum %u", (uint32_t)before_wanted, (uint32_t)last_entry_t); - -/* - if(before_slot >= (size_t)st->entries) - error("INTERNAL CHECK: before_slot is invalid %zu, expected 0 to %ld", before_slot, st->entries - 1); - - if(after_slot >= (size_t)st->entries) - error("INTERNAL CHECK: after_slot is invalid %zu, expected 0 to %ld", after_slot, st->entries - 1); -*/ - if(points_wanted > (before_wanted - after_wanted) / group / update_every + 1) error("INTERNAL CHECK: points_wanted %ld is more than points %ld", points_wanted, (before_wanted - after_wanted) / group / update_every + 1); @@ -1278,6 +1259,7 @@ static RRDR *rrd2rrdr_variablestep( , struct context_param *context_param_list , int timeout ) { + UNUSED(last_entry_t); int aligned = !(options & RRDR_OPTION_NOT_ALIGNED); // the duration of the chart @@ -1360,13 +1342,7 @@ static RRDR *rrd2rrdr_variablestep( // we align the request on requested_before time_t before_wanted = before_requested; - if(likely(before_wanted > last_entry_t)) { - #ifdef NETDATA_INTERNAL_CHECKS - error("INTERNAL ERROR: rrd2rrdr() on %s, before_wanted is after db max", st->name); - #endif - before_wanted = last_entry_t - (last_entry_t % ( ((aligned)?group:1) * update_every )); - } //size_t before_slot = rrdset_time2slot(st, before_wanted); // we need to estimate the number of points, for having @@ -1416,23 +1392,9 @@ static RRDR *rrd2rrdr_variablestep( if(after_wanted < first_entry_t) error("INTERNAL CHECK: after_wanted %u is too small, minimum %u", (uint32_t)after_wanted, (uint32_t)first_entry_t); - if(after_wanted > last_entry_t) - error("INTERNAL CHECK: after_wanted %u is too big, maximum %u", (uint32_t)after_wanted, (uint32_t)last_entry_t); - if(before_wanted < first_entry_t) error("INTERNAL CHECK: before_wanted %u is too small, minimum %u", (uint32_t)before_wanted, (uint32_t)first_entry_t); - if(before_wanted > last_entry_t) - error("INTERNAL CHECK: before_wanted %u is too big, maximum %u", (uint32_t)before_wanted, (uint32_t)last_entry_t); - -/* - if(before_slot >= (size_t)st->entries) - error("INTERNAL CHECK: before_slot is invalid %zu, expected 0 to %ld", before_slot, st->entries - 1); - - if(after_slot >= (size_t)st->entries) - error("INTERNAL CHECK: after_slot is invalid %zu, expected 0 to %ld", after_slot, st->entries - 1); -*/ - if(points_wanted > (before_wanted - after_wanted) / group / update_every + 1) error("INTERNAL CHECK: points_wanted %ld is more than points %ld", points_wanted, (before_wanted - after_wanted) / group / update_every + 1); @@ -1706,9 +1668,6 @@ RRDR *rrd2rrdr( else { if(after_requested < first_entry_t) after_requested = first_entry_t; - - if(before_requested > last_entry_t) - before_requested = last_entry_t; } if(!points_original) |