未验证 提交 383e32b4 编写于 作者: A Ax1an 提交者: GitHub

Fix the persistent session timeout mechanism bug. (#7347)

上级 bf0e22d2
......@@ -112,6 +112,7 @@ Release Notes.
* Enhance persistent session timeout mechanism. Because the enhanced session could cache the metadata metrics forever,
new timeout mechanism is designed for avoiding this specific case.
* Fix Kafka transport topics are created duplicated with and without namespace issue
* Fix the persistent session timeout mechanism bug.
* Fix possible version_conflict_engine_exception in bulk execution.
* Fix PrometheusMetricConverter may throw an `IllegalArgumentException` when convert metrics to SampleFamily
* Filtering NaN value samples when build SampleFamily
......
......@@ -275,7 +275,8 @@ public class MetricsPersistentWorker extends PersistenceWorker<Metrics> {
// Mostly all updatable metadata level metrics are required to do this check.
if (metricsDAO.isExpiredCache(model, cachedValue, currentTimeMillis, metricsDataTTL)) {
// The expired metrics should be tagged `not in cache` directly.
// The expired metrics should be removed from the context and tagged `not in cache` directly.
context.remove(m);
return true;
}
}
......
......@@ -135,7 +135,7 @@ public class MetricsEsDAO extends EsDAO implements IMetricsDAO {
return false;
}
final long deadline = Long.parseLong(new DateTime(currentTimeMillis).plusDays(-ttl).toString("yyyyMMdd"));
final long timeBucket = TimeBucket.getTimeBucket(cachedValue.getTimeBucket(), DownSampling.Day);
final long timeBucket = TimeBucket.getTimeBucket(metricTimestamp, DownSampling.Day);
// If time bucket is earlier or equals(mostly) the deadline, then the cached metric is expired.
if (timeBucket <= deadline) {
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册