diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java index 88ec7f886..db49ff104 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java @@ -67,7 +67,8 @@ public class HistoryDeleteEsDAO extends EsDAO implements IHistoryDeleteDAO { client.deleteByIndexName(prepareDeleteIndex); } String latestIndex = TimeSeriesUtils.latestWriteIndexName(model); - if (!leftIndices.contains(latestIndex)) { + String formattedLatestIndex = client.formatIndexName(latestIndex); + if (!leftIndices.contains(formattedLatestIndex)) { client.createIndex(latestIndex); } }