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

Fix TimeBucket missing in H2, MySQL, TiDB and PostgreSQL bug (#8008)

上级 e575701f
......@@ -54,6 +54,7 @@ Release Notes.
* Set `SW_KAFKA_FETCHER_ENABLE_NATIVE_PROTO_LOG`, `SW_KAFKA_FETCHER_ENABLE_NATIVE_JSON_LOG` default `true`.
* 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`.
#### UI
......
......@@ -80,7 +80,6 @@ public class ServiceTraffic extends Metrics {
public void deserialize(final RemoteData remoteData) {
setName(remoteData.getDataStrings(0));
setNodeType(NodeType.valueOf(remoteData.getDataIntegers(0)));
// Time bucket is not a part of persistent, but still is required in the first time insert.
setTimeBucket(remoteData.getDataLongs(0));
}
......@@ -89,7 +88,6 @@ public class ServiceTraffic extends Metrics {
final RemoteData.Builder builder = RemoteData.newBuilder();
builder.addDataStrings(name);
builder.addDataIntegers(nodeType.value());
// Time bucket is not a part of persistent, but still is required in the first time insert.
builder.addDataLongs(getTimeBucket());
return builder;
}
......@@ -102,6 +100,7 @@ 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());
return serviceTraffic;
}
......@@ -118,6 +117,7 @@ public class ServiceTraffic extends Metrics {
map.put(NAME, serviceName);
map.put(NODE_TYPE, storageData.getNodeType().value());
map.put(GROUP, storageData.getGroup());
map.put(TIME_BUCKET, storageData.getTimeBucket());
return map;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册