From 1d5a0b0f1acd04d1fb98261b5c9fafd64a1c0551 Mon Sep 17 00:00:00 2001 From: Gao Hongtao Date: Fri, 8 May 2020 20:12:56 +0800 Subject: [PATCH] Format index name with namespace (#4758) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Format index name with namespace Signed-off-by: Gao Hongtao * Use another variable to compare index name Signed-off-by: Gao Hongtao Co-authored-by: 吴晟 Wu Sheng --- .../storage/plugin/elasticsearch/base/HistoryDeleteEsDAO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } }