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


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/importer/IndexImporter.java:
##########
@@ -200,6 +208,21 @@ 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
+                    if (idxBuilderType != null &&
+                            !idxBuilderType.equals(indexInfo.type)) {
+
+                        LOG.info("Provided index [{}] has a different type 
compared to the existing index." +
+                                " Using lane from the index definition 
provided", indexInfo.indexPath);
+
+                        List<String> asyncLaneList = 
indexInfo.type.equals(TYPE_ELASTICSEARCH) ?
+                                List.of(indexInfo.asyncLaneName) : 
List.of(indexInfo.asyncLaneName, INDEXING_MODE_NRT);

Review Comment:
   ack, done



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