toffentoffen commented on code in PR #11119:
URL: https://github.com/apache/skywalking/pull/11119#discussion_r1269270265
##########
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java:
##########
@@ -63,20 +62,26 @@ public void deleteHistory(Model model, String
timeBucketColumnName, int ttl) {
}
return;
}
+
+ String latestIndex = TimeSeriesUtils.latestWriteIndexName(model);
+ if (!client.isExistsIndex(latestIndex)) {
+ client.createIndex(latestIndex);
+ if (log.isDebugEnabled()) {
+ log.debug("Latest index = {} is not exist, create.",
latestIndex);
+ }
+ }
Review Comment:
> the index might be created by ES when the data is received
Although this should never happen when the TTL job is working fine, as it
will create the index for the next day in advance, this a scenario to take into
consideration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]