diff options
Diffstat (limited to 'database')
-rw-r--r-- | database/rrd.h | 5 | ||||
-rw-r--r-- | database/rrdset.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/database/rrd.h b/database/rrd.h index 62edec423f..7f8b91f7d2 100644 --- a/database/rrd.h +++ b/database/rrd.h @@ -1150,7 +1150,10 @@ static inline time_t rrdset_first_entry_t_nolock(RRDSET *st) time_t first_entry_t = LONG_MAX; rrddim_foreach_read(rd, st) { - first_entry_t = MIN(first_entry_t, rd->state->query_ops.oldest_time(rd)); + first_entry_t = + MIN(first_entry_t, + rd->state->query_ops.oldest_time(rd) > st->update_every ? + rd->state->query_ops.oldest_time(rd) - st->update_every : 0); } if (unlikely(LONG_MAX == first_entry_t)) return 0; diff --git a/database/rrdset.c b/database/rrdset.c index 25f0bcb7dc..2d3ee96091 100644 --- a/database/rrdset.c +++ b/database/rrdset.c @@ -1362,6 +1362,7 @@ static inline void rrdset_done_fill_the_gap(RRDSET *st) { st->last_updated.tv_sec += c * st->update_every; st->current_entry += c; + st->counter += c; if(st->current_entry >= st->entries) st->current_entry -= st->entries; } |