[Red Hat JIRA] (ISPN-12419) Expose indexed-embedding as a separate annotation in Protobuf index mapping
by Tristan Tarrant (Jira)
[ https://issues.redhat.com/browse/ISPN-12419?page=com.atlassian.jira.plugi... ]
Tristan Tarrant updated ISPN-12419:
-----------------------------------
Fix Version/s: 12.0.0.CR1
(was: 12.0.0.Dev07)
> Expose indexed-embedding as a separate annotation in Protobuf index mapping
> ---------------------------------------------------------------------------
>
> Key: ISPN-12419
> URL: https://issues.redhat.com/browse/ISPN-12419
> Project: Infinispan
> Issue Type: Enhancement
> Components: Remote Querying
> Reporter: Yoann Rodière
> Priority: Major
> Labels: SearchNG
> Fix For: 12.0.0.CR1
>
>
> This ticket is about a behavior change between Infinispan 11 and 12 caused by the upgrade to Hibernate Search 6; it must be addressed before the release of Infinispan 12.
> In Infinispan 11, when mapping a Protobuf type to an index, one must use the {{@Field}} annotation in order to mark a composite type as "embedded", e.g.:
> {code}
> message User {
> /**
> * @Field(store = Store.YES)
> * @SortableField
> */
> required int32 id = 1;
> /**
> * @Field(store = Store.YES)
> */
> optional User manager = 2;
> }
> {code}
> The {{@Field}} annotation on {{manager}} does not actually create a field: instead, it specifies that all fields defined in {{manager}} should be embedded in {{User}}. In this case, it means user will have a field named {{manager.id}}.
> One obvious problem is that we're hijacking an annotation to express something really different from what it was intended for. It would arguably be better to have a dedicated annotation for that kind of embedding, similar to the {{@IndexedEmbedded}} annotation from Hibernate Search.
> But a less obvious and much more problematic consequence of that choice is that we are forced to put implicit limits on recursive models, and users cannot control these limits. Indeed, Infinispan 12 only uses static metamodels when defining Hibernate Search indexes, so infinite recursion is simply not an option. In the example above, we have to declare all fields at bootstrap, and that includes the recursions such as {{manager.id}}, {{manager.manager.id}}, {{manager.manager.manager.id}}, etc. Currently we limit embedding depth to {{7}}, which is very arbitrary.
> To solve _that_ problem, we have two alternatives:
> # Embrace infinite recursion, meaning we will define a dynamic schema. In the example above, we would define static fields {{manager}}, {{manager.id}} and {{manager.manager}}, and inside {{manager}} we would define dynamic fields for path patterns {{\*.manager}} (object field) and {{\*.manager.id}} (Integer field, stored, sortable). The main problem with this behavior is there is a possibility that user schemas introduce conflicts (e.g. two definitions of "manager" in two different embedded types), which will probably lead to runtime errors or non-matching queries.
> # Switch to a dedicated annotation to configure embedding, e.g. {{@IndexedEmbedded}}. This annotation could be unlimited by default. Hibernate Search will throw an exception if that leads infinite recursion, and when that happens, users will be able to set attributes on the annotation to control recursion, for example with {{@IndexedEmbedded(includePaths = <finite list of field paths to embed>)}} or {{@IndexedEmbedded(includeDepth = <depth of recursion when indexing>)}}.
> I'd be in favor of solution 2, which is the solution we implement in the Hibernate Search / Hibernate ORM mapper : https://docs.jboss.org/hibernate/search/6.0/reference/en-US/html_single/#...
> Judging from a previous conversation, it seems [~anistor] [agrees|https://infinispan.zulipchat.com/#narrow/stream/118645-infinispan/...].
> See also the full conversation, starting here: https://infinispan.zulipchat.com/#narrow/stream/118645-infinispan/topic/I...
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
3 years, 5 months
[Red Hat JIRA] (ISPN-12536) Query cache creating create folders in the server bin directory
by Gustavo Fernandes (Jira)
[ https://issues.redhat.com/browse/ISPN-12536?page=com.atlassian.jira.plugi... ]
Gustavo Fernandes reassigned ISPN-12536:
----------------------------------------
Assignee: Gustavo Fernandes
> Query cache creating create folders in the server bin directory
> ---------------------------------------------------------------
>
> Key: ISPN-12536
> URL: https://issues.redhat.com/browse/ISPN-12536
> Project: Infinispan
> Issue Type: Bug
> Reporter: Diego Lovison
> Assignee: Gustavo Fernandes
> Priority: Major
> Attachments: query.diff
>
>
> When creating caches with the attached configuration.
> Infinispan server is creating folders in the bin directory.
> It should be created in the data directory.
> {noformat}
> black_friday.Inventory black_friday.ShoppingProduct cli.log4j2.xml common.sh server.bat service
> black_friday.Product black_friday.User cli.sh report-osx.sh server.conf user-tool.bat
> black_friday.ShoppingCart cli.bat common.bat report.sh server.sh user-tool.sh
> {noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
3 years, 5 months
[Red Hat JIRA] (ISPN-12218) Indexed caches with non-indexed entities query inconsistency
by Tristan Tarrant (Jira)
[ https://issues.redhat.com/browse/ISPN-12218?page=com.atlassian.jira.plugi... ]
Tristan Tarrant updated ISPN-12218:
-----------------------------------
Fix Version/s: 12.0.0.CR1
(was: 12.0.0.Dev07)
> Indexed caches with non-indexed entities query inconsistency
> ------------------------------------------------------------
>
> Key: ISPN-12218
> URL: https://issues.redhat.com/browse/ISPN-12218
> Project: Infinispan
> Issue Type: Bug
> Components: Embedded Querying, Remote Querying
> Affects Versions: 11.0.3.Final
> Reporter: Gustavo Fernandes
> Assignee: Gustavo Fernandes
> Priority: Major
> Labels: SearchNG
> Fix For: 12.0.0.CR1
>
> Attachments: IndexedCacheNonIndexedQueryTest.java
>
>
> When a cache is indexed, but the protobuf entitiy is not:
> "FROM Entity" returns zero results
> "FROM Entity WHERE <predicate>" return results
> It appears in the first case the query goes to the index (that will be empty), but not in the second where it does a non-indexed query
> On a side note, if I configure a cache as indexed, but do not index any type in the protobuf, it returns {{ISPN014054: Trying to execute query from xyz, but no type is indexed on cache}}. This should be improved to mention the schema needs to be changed
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
3 years, 5 months
[Red Hat JIRA] (ISPN-12533) Infinispan is registering Query interceptor when the client cache creation is invalid
by Gustavo Fernandes (Jira)
[ https://issues.redhat.com/browse/ISPN-12533?page=com.atlassian.jira.plugi... ]
Gustavo Fernandes reassigned ISPN-12533:
----------------------------------------
Assignee: Gustavo Fernandes
> Infinispan is registering Query interceptor when the client cache creation is invalid
> -------------------------------------------------------------------------------------
>
> Key: ISPN-12533
> URL: https://issues.redhat.com/browse/ISPN-12533
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Affects Versions: 12.0.0.Dev07
> Reporter: Diego Lovison
> Assignee: Gustavo Fernandes
> Priority: Major
> Attachments: query.diff
>
>
> Build the Infinispan and run {{server.sh}}
> Run the client. It will fail because there is a missing configuration.
> {noformat}
> Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=10 returned server error (status=0x85): org.infinispan.commons.CacheConfigurationException: ISPN028021: The configured indexed-entity type 'black_friday.User' must be indexed. Please annotate it with @Indexed or remove it from the configuration.
> at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:335)
> {noformat}
> Check the server console ( or the server log )
> {noformat}
> the server is registering
> 11:46:34,952 INFO (blocking-thread--p3-t1) [org.infinispan.CONTAINER] ISPN014003: Registering Query interceptor for cache user
> {noformat}
> Stop the server with ctrl + c
> {noformat}
> 11:48:44,318 WARN (Thread-0) [org.infinispan.CONTAINER] ISPN000189: While stopping a cache or cache manager, one of its components failed to stop java.util.concurrent.CompletionException: org.infinispan.commons.CacheConfigurationException: ISPN028021: The configured indexed-entity type 'black_friday.User' must be indexed. Please annotate it with @Indexed or remove it from the configuration.
> at java.base/java.util.concurrent.CompletableFuture.reportJoin(CompletableFuture.java:412)
> at java.base/java.util.concurrent.CompletableFuture.join(CompletableFuture.java:2044)
> at org.infinispan.manager.DefaultCacheManager.terminate(DefaultCacheManager.java:780)
> at org.infinispan.manager.DefaultCacheManager.stopCaches(DefaultCacheManager.java:841)
> at org.infinispan.manager.DefaultCacheManager.internalStop(DefaultCacheManager.java:817)
> at org.infinispan.manager.DefaultCacheManager.stop(DefaultCacheManager.java:793)
> at org.infinispan.server.SecurityActions.lambda$stopCacheManager$2(SecurityActions.java:75)
> at org.infinispan.security.Security.doPrivileged(Security.java:45)
> at org.infinispan.server.SecurityActions.doPrivileged(SecurityActions.java:38)
> at org.infinispan.server.SecurityActions.stopCacheManager(SecurityActions.java:81)
> at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:608)
> at org.infinispan.server.Server.localShutdown(Server.java:484)
> at org.infinispan.server.Server.lambda$run$1(Server.java:410)
> at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
> at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
> at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
> at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
> at org.infinispan.server.DefaultExitHandler.exit(DefaultExitHandler.java:13)
> at org.infinispan.server.ShutdownHook.run(ShutdownHook.java:16)
> Caused by: org.infinispan.commons.Cac^CheManager.internalGetCache(DefaultCacheManager.java:532)
> at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:510)
> at org.infinispan.security.actions.GetCacheAction.run(GetCacheAction.java:26)
> at org.infinispan.security.actions.GetCacheAction.run(GetCacheAction.java:14)
> {noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
3 years, 5 months
[Red Hat JIRA] (ISPN-12534) CacheConfigurationException message ISPN028021 should return that it is missing an annotation in the field
by Gustavo Fernandes (Jira)
[ https://issues.redhat.com/browse/ISPN-12534?page=com.atlassian.jira.plugi... ]
Gustavo Fernandes reassigned ISPN-12534:
----------------------------------------
Assignee: Gustavo Fernandes
> CacheConfigurationException message ISPN028021 should return that it is missing an annotation in the field
> ----------------------------------------------------------------------------------------------------------
>
> Key: ISPN-12534
> URL: https://issues.redhat.com/browse/ISPN-12534
> Project: Infinispan
> Issue Type: Bug
> Components: Remote Querying
> Reporter: Diego Lovison
> Assignee: Gustavo Fernandes
> Priority: Major
> Attachments: query.diff
>
>
> When creating a cache with an indexed entity with the wrong configuration. Infinispan is returning the wrong message.
> If the java class has the following content.
> {code:java}
> @Indexed
> @ProtoDoc("@Indexed")
> public static final class User {
> @ProtoField(number = 1)
> Long id;
> @ProtoField(number = 2)
> String name;
> }
> {code}
> When creating a cache, the server is returning
> {noformat}
> Exception in thread "main" org.infinispan.client.hotrod.exceptions.HotRodClientException:Request for messageId=10 returned server error (status=0x85): org.infinispan.commons.CacheConfigurationException: ISPN028021: The configured indexed-entity type 'black_friday.User' must be indexed. Please annotate it with @Indexed or remove it from the configuration.
> at org.infinispan.client.hotrod.impl.protocol.Codec20.checkForErrorsInResponseStatus(Codec20.java:335)
> {noformat}
> As you can see, the entity has the @Indexed annotation.
> What is missing is the @ProtoDoc annotation in the field, as the following
> {code:java}
> @Indexed
> @ProtoDoc("@Indexed")
> public static final class User {
> @ProtoDoc("@Field(index=Index.YES, analyze = Analyze.YES, store = Store.NO)")
> @ProtoField(number = 1)
> Long id;
> @ProtoField(number = 2)
> String name;
> }
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
3 years, 5 months