This is an automated email from the ASF dual-hosted git repository. wusheng pushed a commit to branch no-init-bug in repository https://gitbox.apache.org/repos/asf/skywalking.git
commit 49da103518fc46c4d9e1b1a58bc36d71885db851 Author: Wu Sheng <[email protected]> AuthorDate: Mon Jun 15 23:28:29 2020 +0800 In no-init mode, should only check the index existence. --- .../storage/plugin/elasticsearch/base/StorageEsInstaller.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java index 2a13160..143d095 100644 --- a/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java +++ b/oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java @@ -53,11 +53,12 @@ public class StorageEsInstaller extends ModelInstaller { protected boolean isExists(Model model) throws StorageException { ElasticSearchClient esClient = (ElasticSearchClient) client; try { - String timeSeriesIndexName = - model.isTimeSeries() ? - TimeSeriesUtils.latestWriteIndexName(model) : - model.getName(); - return esClient.isExistsTemplate(model.getName()) && esClient.isExistsIndex(timeSeriesIndexName); + if (model.isTimeSeries()) { + return esClient.isExistsTemplate(model.getName()) && esClient.isExistsIndex( + TimeSeriesUtils.latestWriteIndexName(model)); + } else { + return esClient.isExistsIndex(model.getName()); + } } catch (IOException e) { throw new StorageException(e.getMessage()); }
