quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

Infinispan - Support caching annotations

Open karesti opened this issue 2 years ago • 25 comments

Caching annotations @CacheInvalidate @CacheInvalidateAll and @CacheResult

https://issues.redhat.com/browse/ISPN-13062

karesti avatar May 02 '22 14:05 karesti

@karesti thanks but could you split that in two different commits? If we have to backport an Infinispan upgrade, I would like to be able to do it easily. Thanks.

gsmet avatar May 02 '22 14:05 gsmet

Infinispan Version Update https://github.com/quarkusio/quarkus/pull/25306

karesti avatar May 02 '22 16:05 karesti

@gwenneg I made locally the small review changes and I will check the 2 PR you mentioned to report the changes here too. I ping you once is ready

karesti avatar May 17 '22 08:05 karesti

Hey,

What's the status of this? This would be a super interesting feature and something that has been requested from the community.

geoand avatar Jun 28 '22 14:06 geoand

@geoand I've been sidetracked too much recently, I need to report the changes reported by @gwenneg

karesti avatar Jun 29 '22 12:06 karesti

Gotcha, thanks for the update

geoand avatar Jun 29 '22 12:06 geoand

@geoand give me some days to get back to it properly. Sorry again

karesti avatar Jun 29 '22 14:06 karesti

NP!

geoand avatar Jun 29 '22 14:06 geoand

Closed by accident, sorry :)

geoand avatar Jun 29 '22 14:06 geoand

@geoand @gwenneg FYI coming back to work on this fully for the next days (and other features preparing the integration with Infinispan 14)

karesti avatar Jul 16 '22 12:07 karesti

👍

geoand avatar Jul 16 '22 12:07 geoand


:waning_crescent_moon: This workflow status is outdated as a new workflow run has been triggered.


Failing Jobs - Building 5a3e1a32426d329117cfdfb58fba21c954d36bd2

Status Name Step Failures Logs Raw logs
Initial JDK 11 Build Build Failures Logs Raw logs

Failures

:gear: Initial JDK 11 Build #

- Failing: extensions/infinispan-client/runtime 
! Skipped: devtools/bom-descriptor-json docs extensions/infinispan-client/deployment and 4 more

:package: extensions/infinispan-client/runtime

Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.20.0:validate (default) on project quarkus-infinispan-client: File '/home/runner/work/quarkus/quarkus/extensions/infinispan-client/runtime/src/main/java/io/quarkus/infinispan/client/runtime/cache/CacheResultInterceptor.java' has not been previously formatted. Please format file (for example by invoking `mvn -f extensions/infinispan-client/runtime net.revelc.code.formatter:formatter-maven-plugin:2.20.0:format`) and commit before running validation!

quarkus-bot[bot] avatar Jul 28 '22 21:07 quarkus-bot[bot]


:waning_crescent_moon: This workflow status is outdated as a new workflow run has been triggered.


Failing Jobs - Building 7b75cb308dcdca020f2cf3f02ce69024121485e8

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Build Failures Logs Raw logs
JVM Tests - JDK 17 Build Failures Logs Raw logs
JVM Tests - JDK 18 Build Failures Logs Raw logs
Native Tests - Cache Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

:gear: JVM Tests - JDK 11 #

- Failing: integration-tests/infinispan-client 

:package: integration-tests/infinispan-client

io.quarkus.it.infinispan.client.InfinispanClientFunctionalityTest.testCacheAnnotations line 60 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Response body doesn't match expectation.

:gear: JVM Tests - JDK 17 #

- Failing: integration-tests/infinispan-client 

:package: integration-tests/infinispan-client

io.quarkus.it.infinispan.client.InfinispanClientFunctionalityTest.testCacheAnnotations line 60 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Response body doesn't match expectation.

:gear: JVM Tests - JDK 18 #

- Failing: integration-tests/infinispan-client 

:package: integration-tests/infinispan-client

io.quarkus.it.infinispan.client.InfinispanClientFunctionalityTest.testCacheAnnotations line 60 - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Response body doesn't match expectation.

:gear: Native Tests - Cache #

- Failing: integration-tests/infinispan-client 

:package: integration-tests/infinispan-client

io.quarkus.it.infinispan.client.InfinispanClientFunctionalityIT.testCacheAnnotations - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Response body doesn't match expectation.

quarkus-bot[bot] avatar Jul 28 '22 21:07 quarkus-bot[bot]

@geoand I need to check the failing test :) I did not run them properly as I thought yesterday, sorry about it

karesti avatar Jul 29 '22 10:07 karesti

No problem :)

geoand avatar Jul 29 '22 10:07 geoand

CI is passing. Is this ready for a review?

geoand avatar Aug 03 '22 07:08 geoand

One thing I would like us to have in mind for a follow-up, is to provider proper metrics (as we do for Caffeine)

geoand avatar Aug 03 '22 07:08 geoand

@geoand yes please

karesti avatar Aug 05 '22 12:08 karesti

One thing I would like us to have in mind for a follow-up, is to provider proper metrics (as we do for Caffeine)

yes, we can totally create an issue to make it happen after that

karesti avatar Aug 05 '22 12:08 karesti

Dump question that has probably been answered before: Do we really want to have a separate set of Infinispan specific annotations instead of reusing the Quarkus Cache annotations?

geoand avatar Aug 08 '22 04:08 geoand

Assuming that's possible (I didn't check), Infinispan could even be a caching provider from quarkus-cache that could be enabled from the quarkus-cache config when the Infinispan extension is on the classpath. Quarkus-cache was built with that kind of integration case in mind.

Unfortunately, this PR already shows that maintaining the duplicated code (annotations and interceptors) won't be an easy task.

gwenneg avatar Aug 08 '22 11:08 gwenneg

@gwenneg there are limitations concerning the local cache of caffeine and how it works with infinispan. For now, I think we need to implement this feature appart from quarkus-cache and then try to implement caching providers of course.

I will report the changes @geoand and @gwenneg hopefully this will be enough to integrate the feature in the infinispan extension

karesti avatar Aug 08 '22 16:08 karesti

Then maybe we need a set of annotation for remote caching specifically?

geoand avatar Aug 08 '22 17:08 geoand

@geoand we might want to think about this but for now the Infinispan team would really like to offer this first implementation in the extension and improve the use through users as well. This feature is taking way too long to overthink it too much right now IMO

karesti avatar Aug 09 '22 09:08 karesti

Yeah, I understand, but would it not make sense to provide the remote caching annotations now? It should not be too much work (theoretically) and it would shield us from moving / breaking the annotations in the future.

I won't block the PR on this suggestion, but I highly suggest it should be given serious thought (cc @gsmet)

geoand avatar Aug 09 '22 09:08 geoand

@geoand I agree on working together towards that goal. I'm reporting the missing changes now, I ping you once it's done! cc @gwenneg

karesti avatar Aug 11 '22 15:08 karesti

Thanks!

geoand avatar Aug 11 '22 15:08 geoand

@geoand @gwenneg how does it look now ?

karesti avatar Aug 11 '22 17:08 karesti

I'll be on PTO for the next 10 days or so

geoand avatar Aug 12 '22 06:08 geoand

I just came back from PTO. I'll have a look at this PR later today.

gwenneg avatar Aug 16 '22 09:08 gwenneg