wu-sheng commented on a change in pull request #7772:
URL: https://github.com/apache/skywalking/pull/7772#discussion_r714425557



##########
File path: 
oap-server/server-storage-plugin/storage-elasticsearch-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/elasticsearch/base/StorageEsInstaller.java
##########
@@ -70,14 +70,17 @@ protected boolean isExists(Model model) {
         if (!model.isTimeSeries()) {
             return esClient.isExistsIndex(tableName);
         }
-        boolean exist = esClient.isExistsTemplate(tableName)
-            && 
esClient.isExistsIndex(TimeSeriesUtils.latestWriteIndexName(model));
+        boolean templateExists = esClient.isExistsTemplate(tableName);
         final Optional<IndexTemplate> template = 
esClient.getTemplate(tableName);
+        boolean lastIndexExists = 
esClient.isExistsIndex(TimeSeriesUtils.latestWriteIndexName(model));
 
-        if ((exist && !template.isPresent()) || (!exist && 
template.isPresent())) {
-            throw new Error("[Bug warning]ElasticSearch client query template 
result is not consistent. Please file an issue to Apache 
SkyWalking.(https://github.com/apache/skywalking/issues)");
+        if ((templateExists && !template.isPresent()) || (!templateExists && 
template.isPresent())) {

Review comment:
       > The supported versions are fixed and the codes won't run on un-tested 
versions.
   
   I know we have `{"6.3.2"}, {"7.4.2"}, {"7.8.0"}, {"7.10.2"}`, but who knows 
one day, something breaks unexpected, such as we never knew in the `7.x` there 
are different cases.
   
   > It's good to me to keep the new condition, but please also add a test to
   
   Added check for template existing check.




-- 
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]


Reply via email to