Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-14127 Support non blocking guarantees on indexing APIs #10305

Merged
merged 5 commits into from Sep 23, 2022

Conversation

fax4ever
Copy link
Contributor

@fax4ever fax4ever commented Sep 12, 2022

Copy link
Member

@wburns wburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor comments.

You can feel free to squash my original work commit btw as well :)

this.indexProcessor = UnicastProcessor.<IndexingOperation>create().toSerialized();

indexProcessor
.observeOn(Schedulers.from(blockingManager.asExecutor("search-indexer")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't put this on my original branch to you. But it would be a ton better if we could have some sort of lifecycle that shuts down the processor (invokes onComplete). But I don't know how hard that is to add.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure we can do that!


/**
* @author Fabio Massimo Ercoli
*/
public class SearchIndexerImpl implements SearchIndexer {

private static final Log log = LoggerFactory.make(Log.class, MethodHandles.lookup());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use the Log impls provided from ISPN? Or is this just a query thing that it uses the Hibernate ones?

Copy link
Contributor Author

@fax4ever fax4ever Sep 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the search integration operations we usually use the org.infinispan.search.mapper.log.impl,Log, that is an Infinispan log of the search mapper submodule of the query module.
The reason for the existence of this log impl class is the fact that when we did the integration with Hibernate Search 6 we had an Infinispan Search Mapper module that was merged with the query module, but the Log impl files weren't.

@@ -40,4 +40,8 @@ public interface Log extends BasicLogger {
SearchException invalidEntitySuperType(String entityName,
@FormatWith(ClassFormatter.class) Class<?> expectedSuperType,
@FormatWith(ClassFormatter.class) Class<?> actualJavaType);

@Message(id = 14507, value = "Error processing indexing operation.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be at least an ERROR. If this ever occurs, indexing will no longer work so it needs to be a prominent message.

@@ -47,9 +67,9 @@ public CompletableFuture<?> addOrUpdate(Object providedId, String routingKey, Ob
return CompletableFuture.completedFuture(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this before, all of these references should be replaced with CompletableFutures.completedNull()


/**
* Test the parsing and transformation of Ickle queries to Lucene queries.
*
* @author anistor@redhat.com
* @since 9.0
*/
public class LuceneTransformationTest {
public class LuceneTransformationTest extends SingleCacheManagerTest {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran this test with the changes and the SearchIndexImpl was never hit it? Is this test supposed to do any indexing via SearchIndexImpl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It is possible, if no indexing operations are executed. I'm checking it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked. The SearchIndexImpl is created when the search mapping is created for the test and even if we're not going to index anything the constructor requires the managers to init the flow processor, I think

@fax4ever
Copy link
Contributor Author

fax4ever commented Sep 14, 2022

--- closed the wrong PR ---

@fax4ever fax4ever closed this Sep 14, 2022
@fax4ever fax4ever deleted the ISPN-14127 branch September 14, 2022 19:15
@fax4ever fax4ever restored the ISPN-14127 branch September 14, 2022 19:16
@fax4ever fax4ever reopened this Sep 14, 2022
@fax4ever
Copy link
Contributor Author

@wburns thanks again for the review! I updated the PR with the related changes

@wburns
Copy link
Member

wburns commented Sep 20, 2022

Looks good to me. I did notice there is a leaked thread failure now due to it though and possibly a mass indexer one?

https://ci.infinispan.org/job/Infinispan/job/PR-10305/7/

@fax4ever
Copy link
Contributor Author

Looks good to me. I did notice there is a leaked thread failure now due to it though and possibly a mass indexer one?

https://ci.infinispan.org/job/Infinispan/job/PR-10305/7/

I think that we still sometimes have this issue with the current master.
The problem with this case is the fact that by the time the test finishes some purge operations are in progress generated as a result of some SegmentListener.topologyChanged.
I think that we should better synchronize these events, but I think that this is not related to these PR changes.

@wburns wburns merged commit 922732a into infinispan:main Sep 23, 2022
@wburns
Copy link
Member

wburns commented Sep 23, 2022

Integrated into main, thanks @fax4ever !

@fax4ever
Copy link
Contributor Author

Integrated into main, thanks @fax4ever !

Thanks to you @wburns for explaining to me the flowable stuff :)

@fax4ever fax4ever deleted the ISPN-14127 branch September 23, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants