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

ebean-k8scache and ebean-cluster not invalidated when only remoteTableMod or remoteCacheEvent #2108

Closed
rbygrave opened this issue Nov 19, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@rbygrave
Copy link
Member

When I look at the RemoteTransactionEvent class, the method isEmpty() it does not check if the remoteCacheEvent or the remoteTableMod object is filled. ...

This is a bug. The RemoteTransactionEvent.isEmpty() should check remoteTableMod and remoteCacheEvent.


Hello,

I tried to get EBean working in a Kubernetes cluster. I followed these steps:

https:/ebean-orm/ebean-k8scache

I needed some extra steps, but now it is working. Additional steps needed were:

Adding cluster-admin rights to the default user, otherwise you cannot ask the API what the other nodes are

Adding environment variable POD_NAME to the container (EBean looks for this and apparently it is not a default variable?)

Adding namespace variable to EBean (otherwise you get null).

Now it works, but the cache is only sometimes synchronized between the clusters (only when I query outside EBean). After looking and digging a long time I found that when I add an AbstractBeanPersistListener class to the config it works. Now I am not really sure if I am doing something wrong, or not. When I look at the RemoteTransactionEvent class, the method isEmpty() it does not check if the remoteCacheEvent or the remoteTableMod object is filled. Adding the abstract listener caused the beanPersistList not to be empty anymore and hence it send the cache request to the other nodes. Maybe I configured something wrong?

I think this will also cause problems in non-kubernetes environments as basically the same code is also used in the manual discovery variant.

tested in EBean 12.4.1

Regards and thanks,

Roland

@rbygrave rbygrave added the bug label Nov 19, 2020
@rbygrave rbygrave self-assigned this Nov 19, 2020
@rbygrave
Copy link
Member Author

Note that it doesn't affect ebean-redis, ebean-hazelcast or ebean-ignite which are by far the most popular L2 cache options. It doesn't impact these L2 cache implementations because they act as either a central cache or a distributed cache. That means that the cache invalidation (clear, delete etc) happens such that they do not need / use io.ebeaninternal.server.cluster.ClusterBroadcast.

Only ebean-k8scache and ebean-cluster have a ClusterBroadcastFactory and ClusterBroadcast.

rbygrave added a commit that referenced this issue Nov 24, 2020
@rbygrave rbygrave added this to the 12.6.1 milestone Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant