diff options
author | Markos Fountoulakis <44345837+mfundul@users.noreply.github.com> | 2019-10-07 16:02:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-07 16:02:38 +0300 |
commit | 1d598c9c38a07979de6ebec76cf7bac6b439bad3 (patch) | |
tree | 7d9f86fc8c2c25ea7c1a3b5a52b54dc5efb69f71 /database | |
parent | 1ad7e905d3401cced05b464091145361aa1ec25a (diff) |
Handle cases where metric timestamps are inversed and data collection interval rounds to 0 (#7008)
Diffstat (limited to 'database')
-rw-r--r-- | database/engine/rrdengineapi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/database/engine/rrdengineapi.c b/database/engine/rrdengineapi.c index 79fc02e93e..5fa23d8fd8 100644 --- a/database/engine/rrdengineapi.c +++ b/database/engine/rrdengineapi.c @@ -309,8 +309,9 @@ unsigned rrdeng_variable_step_boundaries(RRDSET *st, time_t start_time, time_t e curr = &page_info_array[i]; *pginfo_to_points(curr) = 0; /* initialize to invalid page */ *pginfo_to_dt(curr) = 0; /* no known data collection interval yet */ - if (unlikely(INVALID_TIME == curr->start_time || INVALID_TIME == curr->end_time)) { - info("Ignoring page with invalid timestamp."); + if (unlikely(INVALID_TIME == curr->start_time || INVALID_TIME == curr->end_time || + curr->end_time < curr->start_time)) { + info("Ignoring page with invalid timestamps."); prev = old_prev; continue; } @@ -363,7 +364,7 @@ unsigned rrdeng_variable_step_boundaries(RRDSET *st, time_t start_time, time_t e continue; } - if (unlikely(0 == dt)) { /* unknown data collection interval */ + if (unlikely(0 == *pginfo_to_dt(curr))) { /* unknown data collection interval */ assert(1 == page_points); if (likely(NULL != prev)) { /* get interval from previous page */ |