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


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/importer/IndexImporter.java:
##########
@@ -200,6 +208,20 @@ void switchLanes() throws CommitFailedException {
                 if (!indexInfo.newIndex) {
                     NodeBuilder idxBuilder = 
NodeStoreUtils.childBuilder(builder, indexInfo.indexPath);
                     indexPathsToUpdate.add(indexInfo.indexPath);
+                    String idxBuilderType = 
idxBuilder.getString(TYPE_PROPERTY_NAME);
+
+                    // check if provided index definitions is of different 
type than existing one
+                    // also check if one of them is an elasticsearch type
+                    if (idxBuilderType != null &&
+                            !idxBuilderType.equals(indexInfo.type) &&
+                            (idxBuilderType.equals(TYPE_ELASTICSEARCH) || 
indexInfo.type.equals(TYPE_ELASTICSEARCH))) {

Review Comment:
   this logic is needed in case an index definition gets reindexed with a 
different `async` configuration from the one in the existing definition. This 
mainly happens when an index is converted to another type (eg: from lucene to 
elasticsearch or viceversa).
   
   > i think whatever be the async lane's value, we should update that in new 
index.
   I agree. We decided to change this behaviour only when there is a change of 
type and elastic is involved to be more conservative.



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