To determine if the cache contains the values from the request range value cache:
1) first finds the timestamp of the first requested value,
2) checks if the value is in cached range.
If the system clock advances to a new second (for example from 12:00:00.999 to 12:00:01.000) between those checks the timestamp calculated by (1) will be outside the covered range calculated by (2) and value cache will attempt to load values from database.
To fix it value cache must remember not only the maximum request range, but also the first timestmap of the time range that was read from database. This timestamp will be used to determine if cache contains the requested data for range based requests.
This timestamp must be updated when:
1) values are loaded from database
2) values are dropped from cache
3) value with timestamp less than the first value in cache is being added to cache