未验证 提交 50cc0445 编写于 作者: wu-sheng's avatar wu-sheng 提交者: GitHub

Make new TimeBucket in ElasticSearch compatible with old versions. (#8027)

上级 966a710c
......@@ -57,6 +57,7 @@ Release Notes.
* Fix unexpected deleting due to TTL mechanism bug for H2, MySQL, TiDB and PostgreSQL.
* Add a GraphQL query to get OAP version, display OAP version in startup message and error logs.
* Fix TimeBucket missing in H2, MySQL, TiDB and PostgreSQL bug, which causes TTL doesn't work for `service_traffic`.
* Fix TimeBucket missing in ElasticSearch and provide compatible `storage2Entity` for previous versions.
* Fix ElasticSearch implementation of `queryMetricsValues` and `readLabeledMetricsValues` doesn't fill default values
when no available data in the ElasticSearch server.
......
......@@ -100,7 +100,10 @@ public class ServiceTraffic extends Metrics {
serviceTraffic.setName((String) dbMap.get(NAME));
serviceTraffic.setNodeType(NodeType.valueOf(((Number) dbMap.get(NODE_TYPE)).intValue()));
serviceTraffic.setGroup((String) dbMap.get(GROUP));
serviceTraffic.setTimeBucket(((Number) dbMap.get(TIME_BUCKET)).longValue());
// TIME_BUCKET column could be null in old implementation, which is fixed in 8.9.0
if (dbMap.containsKey(TIME_BUCKET)) {
serviceTraffic.setTimeBucket(((Number) dbMap.get(TIME_BUCKET)).longValue());
}
return serviceTraffic;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册