fabriziofortino commented on code in PR #1217:
URL: https://github.com/apache/jackrabbit-oak/pull/1217#discussion_r1397537927


##########
oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticConnectionRule.java:
##########
@@ -48,8 +48,16 @@ public class ElasticConnectionRule extends ExternalResource {
     private ElasticConnectionModel elasticConnectionModel;
 
     public ElasticConnectionRule(String elasticConnectionString) {
+        this(elasticConnectionString,
+                "elastic_test_" +
+                        RandomStringUtils.random(5, true, false).toLowerCase() 
+
+                        System.currentTimeMillis()
+        );
+    }
+
+    public ElasticConnectionRule(String elasticConnectionString, String 
indexPrefix) {
         this.elasticConnectionString = elasticConnectionString;
-        indexPrefix = "elastic_test_" + RandomStringUtils.random(5, true, 
false).toLowerCase();
+        this.indexPrefix = indexPrefix;

Review Comment:
   This configuration should be used only for testing. Unfortunately, I could 
not find a better way to make index names consistent across executions.
   
   In case this option is used in production, index names will clash and 
reindex won't work. We can potentially handle this case by detecting the fact 
the index name is static and instead of deleting the old one, we empty the 
existing and start reindexing.  This is not advisable anyway. With dynamic 
index names, we have the possibility to trigger reindexing and then switch the 
alias only when it is completed. During this time, queries will still use the 
old index. Static index names could lead to inconsistent results during 
reindexing.



-- 
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: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to