[JBoss JIRA] (ISPN-4973) DataRehashed an CacheEntryInvalidated events are not fired on cache
by William Burns (JIRA)
[ https://issues.jboss.org/browse/ISPN-4973?page=com.atlassian.jira.plugin.... ]
William Burns commented on ISPN-4973:
-------------------------------------
I misunderstood the test it is deploying the changes as a war in each server and configuring the server on the fly. I will need to look closer to the specific case as using a more general case in core alone these events work fine in both sync and async listener modes.
> DataRehashed an CacheEntryInvalidated events are not fired on cache
> -------------------------------------------------------------------
>
> Key: ISPN-4973
> URL: https://issues.jboss.org/browse/ISPN-4973
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 7.0.0.CR1, 7.0.0.CR2, 7.0.0.Final
> Reporter: Vitalii Chepeliuk
> Assignee: William Burns
>
> Two async listeners created {InvalidationListener, DistributionListener} and check if async events are fired on cache
> * InvalidationListener
> {code}
> /**
> * Custom listener for handling notification events.
> */
> @Listener(sync=false)
> public class InvalidationListener {
> public AtomicInteger keyId = new AtomicInteger();
> public String nodeName;
> public Thread threadRunningNotif;
> public volatile boolean isInvalidated = false;
> public InvalidationListener(final String nodeName) {
> this.nodeName = nodeName;
> }
> /**
> * Handles the entry created event.
> * @param event
> */
> @CacheEntryCreated
> public void handleCreationAndModification(Event event) {
> if(event.isPre()) {
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> /**
> * Handles the entry invalidated event.
> * @param event
> */
> @CacheEntryInvalidated
> public void handleInvalidation(CacheEntryInvalidatedEvent event) {
> if (event.isPre()) {
> System.out.println("Data is invalidated.");
> isInvalidated = true;
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> {code}
> * DistributionListener
> {code}
> /**
> * Custom listener for verifying all notificaitions.
> */
> @Listener(sync=false)
> public class DistributionListener {
> public AtomicInteger keyId = new AtomicInteger();
> public String nodeName;
> public Thread topologyThreadRunningNotif = null;
> public Thread threadRunningNotif;
> public volatile boolean isRehashed= false;
> public volatile boolean isTopologyChanged = false;
> public DistributionListener(final String nodeName) {
> this.nodeName = nodeName;
> }
> /**
> * Handling data creation event.
> * @param event
> */
> @CacheEntryCreated
> public void handleCreationAndModification(Event event) {
> if(event.isPre()) {
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> /**
> * Handles data rehashed event.
> * @param evn
> */
> @DataRehashed
> public void handleDataRehash(Event evn) {
> if(evn.isPre()) {
> System.out.println("Data Rehashed on " + nodeName);
> isRehashed = true;
> threadRunningNotif = Thread.currentThread();
> }
> }
> /**
> * Handles cluster topology changed event.
> * @param event
> */
> @TopologyChanged
> public void handleTopologyChange(TopologyChangedEvent event) {
> if(!event.isPre()) {
> System.out.println("Topology changed." + nodeName);
> isTopologyChanged = true;
> topologyThreadRunningNotif = Thread.currentThread();
> }
> }
> }
> {code}
> no CacheEntryInvalidated event is fired
> {code}
> /**
> * Checks that the cache on node1 is invalidated and the CacheInvalidated event is fired and the notification went
> * asynchronously.
> *
> * @throws Exception
> */
> @Test
> @OperateOnDeployment("node1")
> @InSequence(3)
> public void testNode1Invalidation() throws Exception {
> eventually("The elements should be invalidated.", new Condition() {
> @Override
> public boolean isSatisfied() throws Exception {
> return listenerNode1.isInvalidated;
> }
> }, 15000, 15);
> assertTrue("The invalidation should be done asynchronously", listenerNode1.threadRunningNotif != Thread.currentThread());
> assertTrue("The number of called invalidation method should be <= 50, but is " + listenerNode1.keyId.get(), listenerNode1.keyId.get() <= 50);
> }
> {code}
> No DataRehashed event is fired
> {code}
> /**
> * Verifying that the data has been rehashed on node1, the event DataRehashed was fired and the notification was
> * asynchronous.
> * @throws Exception
> */
> @Test
> @OperateOnDeployment("node1")
> @InSequence(3)
> public void testDataRehashEventNode1Verifying() throws Exception {
> eventually("The rehash should happen.", new Condition() {
> @Override
> public boolean isSatisfied() throws Exception {
> return listenerNode1.isRehashed;
> }
> }, 15000, 15);
> assertTrue("The rehash listener thread should be different rather than the current.", Thread.currentThread() != listenerNode1.threadRunningNotif);
> assertTrue("The topology should be changed so far on node1.", listenerNode1.isTopologyChanged);
> assertTrue("The topology should be changed with different thread rather than this one on node1.", listenerNode1.topologyThreadRunningNotif != Thread.currentThread());
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months
[JBoss JIRA] (ISPN-3203) Infinispan cache index not loading initial data
by Sanne Grinovero (JIRA)
[ https://issues.jboss.org/browse/ISPN-3203?page=com.atlassian.jira.plugin.... ]
Sanne Grinovero edited comment on ISPN-3203 at 12/8/14 11:49 AM:
-----------------------------------------------------------------
I Ralph, I think the reference to Hibernate might be confusing. Infinispan uses {{Hibernate Search}} internally to do its indexing, which is NOT {{Hibernate ORM}}. So effectively doing some fine-tuning configuration of the indexing engine requires to get some familiarity with the {{Hibernate Search}} configuration. That's just to clarify that while your specific application might not be using Hibernate, Infinispan's indexing engine is using one of the libraries from the Hibernate project (although not the well known ORM but a different one).
I've just opened https://issues.jboss.org/browse/ISPN-5058 as this obviously needs an example, I shouldn't expect you to read all about the internal implementation.
Anyway: you don't need to add a specific Lucene index Cache Loader. You jut have to enable any of the standard Infinispan's CacheLoader implementations for the Cache(s) you're using to store the index.
was (Author: sannegrinovero):
I Ralph, I think the reference to Hibernate might be confusing. Infinispan uses {{Hibernate Search}} internally to do its indexing, which is NOT {{Hibernate ORM}}. So effectively doing some fine-tuning configuration of the indexing engine requires to get some familiarity with the {{Hibernate Search}} configuration.
I've just opened https://issues.jboss.org/browse/ISPN-5058 as this obviously needs an example, I shouldn't expect you to read all about the internal implementation.
Anyway: you don't need to add a specific Lucene index Cache Loader. You jut have to enable any of the standard Infinispan's CacheLoader implementations for the Cache(s) you're using to store the index.
> Infinispan cache index not loading initial data
> -----------------------------------------------
>
> Key: ISPN-3203
> URL: https://issues.jboss.org/browse/ISPN-3203
> Project: Infinispan
> Issue Type: Bug
> Components: Embedded Querying
> Environment: Linux: debian wheezy
> uname -a: Linux hostname 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
> JBoss: 7.1.2.Final
> Embedded cache using infinispan 5.2.6.Final jars included in WAR's WEB-INF/lib directory.
> Reporter: Ralph Jennings
> Assignee: Sanne Grinovero
> Labels: cache-store, index, infinispan, preload
>
> If you create a cache with an existing store to preload data from, the data is available to the cache (get and keySet works) but not to the index (no cache queries work).
> Only entries put into the cache after it starts up can be seen by the index.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months
[JBoss JIRA] (ISPN-3203) Infinispan cache index not loading initial data
by Sanne Grinovero (JIRA)
[ https://issues.jboss.org/browse/ISPN-3203?page=com.atlassian.jira.plugin.... ]
Sanne Grinovero commented on ISPN-3203:
---------------------------------------
I Ralph, I think the reference to Hibernate might be confusing. Infinispan uses {{Hibernate Search}} internally to do its indexing, which is NOT {{Hibernate ORM}}. So effectively doing some fine-tuning configuration of the indexing engine requires to get some familiarity with the {{Hibernate Search}} configuration.
I've just opened https://issues.jboss.org/browse/ISPN-5058 as this obviously needs an example, I shouldn't expect you to read all about the internal implementation.
Anyway: you don't need to add a specific Lucene index Cache Loader. You jut have to enable any of the standard Infinispan's CacheLoader implementations for the Cache(s) you're using to store the index.
> Infinispan cache index not loading initial data
> -----------------------------------------------
>
> Key: ISPN-3203
> URL: https://issues.jboss.org/browse/ISPN-3203
> Project: Infinispan
> Issue Type: Bug
> Components: Embedded Querying
> Environment: Linux: debian wheezy
> uname -a: Linux hostname 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
> JBoss: 7.1.2.Final
> Embedded cache using infinispan 5.2.6.Final jars included in WAR's WEB-INF/lib directory.
> Reporter: Ralph Jennings
> Assignee: Sanne Grinovero
> Labels: cache-store, index, infinispan, preload
>
> If you create a cache with an existing store to preload data from, the data is available to the cache (get and keySet works) but not to the index (no cache queries work).
> Only entries put into the cache after it starts up can be seen by the index.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months
[JBoss JIRA] (ISPN-4126) Memory is pre-allocated when enable eviction, and it may cause OOM even if there is no entry stored in cache.
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-4126?page=com.atlassian.jira.plugin.... ]
Dan Berindei commented on ISPN-4126:
------------------------------------
[~hbhztianwei] What's the point in enabling eviction if you don't know how many entries is too much? The overhead of an entry in the {{DataContainer}} should be quite small compared to the actual key and value, so even if this is fixed you'll get the OOME before you insert 10% of maxEntries in your cache(s).
> Memory is pre-allocated when enable eviction, and it may cause OOM even if there is no entry stored in cache.
> -------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-4126
> URL: https://issues.jboss.org/browse/ISPN-4126
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Reporter: tina tian
> Assignee: William Burns
> Priority: Critical
>
> I am considering to use Infinispan as a single cache in my project, and I met a memory problem when I enabled eviction. Memory is pre-allocated according to the maxEntries you set even if no entry is stored in that cache!
> This is really a critical issue, since most time you are not sure how many entries you are going to store in the cache, you set a maxEntries to avoid OOME, but now, when you set maxEntries, memory will be pre-allocated no matter you are going to use it or not!
> Ehcache used to have this kind of problem too, but they solved it DEV-9437.
> Step to reproduce:
> 1) Enable eviction on config
> 2) Set maxEntries to a big number, like 100000
> 3) Create 100 caches using the default config
> You will see OOM or big usage of memory.
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months
[JBoss JIRA] (ISPN-4973) DataRehashed an CacheEntryInvalidated events are not fired on cache
by William Burns (JIRA)
[ https://issues.jboss.org/browse/ISPN-4973?page=com.atlassian.jira.plugin.... ]
William Burns commented on ISPN-4973:
-------------------------------------
Can you confirm [~vchepeli] ?
> DataRehashed an CacheEntryInvalidated events are not fired on cache
> -------------------------------------------------------------------
>
> Key: ISPN-4973
> URL: https://issues.jboss.org/browse/ISPN-4973
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 7.0.0.CR1, 7.0.0.CR2, 7.0.0.Final
> Reporter: Vitalii Chepeliuk
> Assignee: William Burns
>
> Two async listeners created {InvalidationListener, DistributionListener} and check if async events are fired on cache
> * InvalidationListener
> {code}
> /**
> * Custom listener for handling notification events.
> */
> @Listener(sync=false)
> public class InvalidationListener {
> public AtomicInteger keyId = new AtomicInteger();
> public String nodeName;
> public Thread threadRunningNotif;
> public volatile boolean isInvalidated = false;
> public InvalidationListener(final String nodeName) {
> this.nodeName = nodeName;
> }
> /**
> * Handles the entry created event.
> * @param event
> */
> @CacheEntryCreated
> public void handleCreationAndModification(Event event) {
> if(event.isPre()) {
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> /**
> * Handles the entry invalidated event.
> * @param event
> */
> @CacheEntryInvalidated
> public void handleInvalidation(CacheEntryInvalidatedEvent event) {
> if (event.isPre()) {
> System.out.println("Data is invalidated.");
> isInvalidated = true;
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> {code}
> * DistributionListener
> {code}
> /**
> * Custom listener for verifying all notificaitions.
> */
> @Listener(sync=false)
> public class DistributionListener {
> public AtomicInteger keyId = new AtomicInteger();
> public String nodeName;
> public Thread topologyThreadRunningNotif = null;
> public Thread threadRunningNotif;
> public volatile boolean isRehashed= false;
> public volatile boolean isTopologyChanged = false;
> public DistributionListener(final String nodeName) {
> this.nodeName = nodeName;
> }
> /**
> * Handling data creation event.
> * @param event
> */
> @CacheEntryCreated
> public void handleCreationAndModification(Event event) {
> if(event.isPre()) {
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> /**
> * Handles data rehashed event.
> * @param evn
> */
> @DataRehashed
> public void handleDataRehash(Event evn) {
> if(evn.isPre()) {
> System.out.println("Data Rehashed on " + nodeName);
> isRehashed = true;
> threadRunningNotif = Thread.currentThread();
> }
> }
> /**
> * Handles cluster topology changed event.
> * @param event
> */
> @TopologyChanged
> public void handleTopologyChange(TopologyChangedEvent event) {
> if(!event.isPre()) {
> System.out.println("Topology changed." + nodeName);
> isTopologyChanged = true;
> topologyThreadRunningNotif = Thread.currentThread();
> }
> }
> }
> {code}
> no CacheEntryInvalidated event is fired
> {code}
> /**
> * Checks that the cache on node1 is invalidated and the CacheInvalidated event is fired and the notification went
> * asynchronously.
> *
> * @throws Exception
> */
> @Test
> @OperateOnDeployment("node1")
> @InSequence(3)
> public void testNode1Invalidation() throws Exception {
> eventually("The elements should be invalidated.", new Condition() {
> @Override
> public boolean isSatisfied() throws Exception {
> return listenerNode1.isInvalidated;
> }
> }, 15000, 15);
> assertTrue("The invalidation should be done asynchronously", listenerNode1.threadRunningNotif != Thread.currentThread());
> assertTrue("The number of called invalidation method should be <= 50, but is " + listenerNode1.keyId.get(), listenerNode1.keyId.get() <= 50);
> }
> {code}
> No DataRehashed event is fired
> {code}
> /**
> * Verifying that the data has been rehashed on node1, the event DataRehashed was fired and the notification was
> * asynchronous.
> * @throws Exception
> */
> @Test
> @OperateOnDeployment("node1")
> @InSequence(3)
> public void testDataRehashEventNode1Verifying() throws Exception {
> eventually("The rehash should happen.", new Condition() {
> @Override
> public boolean isSatisfied() throws Exception {
> return listenerNode1.isRehashed;
> }
> }, 15000, 15);
> assertTrue("The rehash listener thread should be different rather than the current.", Thread.currentThread() != listenerNode1.threadRunningNotif);
> assertTrue("The topology should be changed so far on node1.", listenerNode1.isTopologyChanged);
> assertTrue("The topology should be changed with different thread rather than this one on node1.", listenerNode1.topologyThreadRunningNotif != Thread.currentThread());
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months
[JBoss JIRA] (ISPN-4973) DataRehashed an CacheEntryInvalidated events are not fired on cache
by William Burns (JIRA)
[ https://issues.jboss.org/browse/ISPN-4973?page=com.atlassian.jira.plugin.... ]
William Burns commented on ISPN-4973:
-------------------------------------
Looking at the test in general, there seems to be a flaw.
The rehash test does not actually cause a rehash to occurr. This only happens in a distributed cache when a node leaves or joins. The test seems to be assuming a clear will do this.
The invalidation test doesn't appear to be using an invalidation cache. The cache entry invalidation event only fires on caches of that type when a new value is put in.
> DataRehashed an CacheEntryInvalidated events are not fired on cache
> -------------------------------------------------------------------
>
> Key: ISPN-4973
> URL: https://issues.jboss.org/browse/ISPN-4973
> Project: Infinispan
> Issue Type: Bug
> Components: Core
> Affects Versions: 7.0.0.CR1, 7.0.0.CR2, 7.0.0.Final
> Reporter: Vitalii Chepeliuk
> Assignee: William Burns
>
> Two async listeners created {InvalidationListener, DistributionListener} and check if async events are fired on cache
> * InvalidationListener
> {code}
> /**
> * Custom listener for handling notification events.
> */
> @Listener(sync=false)
> public class InvalidationListener {
> public AtomicInteger keyId = new AtomicInteger();
> public String nodeName;
> public Thread threadRunningNotif;
> public volatile boolean isInvalidated = false;
> public InvalidationListener(final String nodeName) {
> this.nodeName = nodeName;
> }
> /**
> * Handles the entry created event.
> * @param event
> */
> @CacheEntryCreated
> public void handleCreationAndModification(Event event) {
> if(event.isPre()) {
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> /**
> * Handles the entry invalidated event.
> * @param event
> */
> @CacheEntryInvalidated
> public void handleInvalidation(CacheEntryInvalidatedEvent event) {
> if (event.isPre()) {
> System.out.println("Data is invalidated.");
> isInvalidated = true;
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> {code}
> * DistributionListener
> {code}
> /**
> * Custom listener for verifying all notificaitions.
> */
> @Listener(sync=false)
> public class DistributionListener {
> public AtomicInteger keyId = new AtomicInteger();
> public String nodeName;
> public Thread topologyThreadRunningNotif = null;
> public Thread threadRunningNotif;
> public volatile boolean isRehashed= false;
> public volatile boolean isTopologyChanged = false;
> public DistributionListener(final String nodeName) {
> this.nodeName = nodeName;
> }
> /**
> * Handling data creation event.
> * @param event
> */
> @CacheEntryCreated
> public void handleCreationAndModification(Event event) {
> if(event.isPre()) {
> threadRunningNotif = Thread.currentThread();
> keyId.getAndIncrement();
> }
> }
> /**
> * Handles data rehashed event.
> * @param evn
> */
> @DataRehashed
> public void handleDataRehash(Event evn) {
> if(evn.isPre()) {
> System.out.println("Data Rehashed on " + nodeName);
> isRehashed = true;
> threadRunningNotif = Thread.currentThread();
> }
> }
> /**
> * Handles cluster topology changed event.
> * @param event
> */
> @TopologyChanged
> public void handleTopologyChange(TopologyChangedEvent event) {
> if(!event.isPre()) {
> System.out.println("Topology changed." + nodeName);
> isTopologyChanged = true;
> topologyThreadRunningNotif = Thread.currentThread();
> }
> }
> }
> {code}
> no CacheEntryInvalidated event is fired
> {code}
> /**
> * Checks that the cache on node1 is invalidated and the CacheInvalidated event is fired and the notification went
> * asynchronously.
> *
> * @throws Exception
> */
> @Test
> @OperateOnDeployment("node1")
> @InSequence(3)
> public void testNode1Invalidation() throws Exception {
> eventually("The elements should be invalidated.", new Condition() {
> @Override
> public boolean isSatisfied() throws Exception {
> return listenerNode1.isInvalidated;
> }
> }, 15000, 15);
> assertTrue("The invalidation should be done asynchronously", listenerNode1.threadRunningNotif != Thread.currentThread());
> assertTrue("The number of called invalidation method should be <= 50, but is " + listenerNode1.keyId.get(), listenerNode1.keyId.get() <= 50);
> }
> {code}
> No DataRehashed event is fired
> {code}
> /**
> * Verifying that the data has been rehashed on node1, the event DataRehashed was fired and the notification was
> * asynchronous.
> * @throws Exception
> */
> @Test
> @OperateOnDeployment("node1")
> @InSequence(3)
> public void testDataRehashEventNode1Verifying() throws Exception {
> eventually("The rehash should happen.", new Condition() {
> @Override
> public boolean isSatisfied() throws Exception {
> return listenerNode1.isRehashed;
> }
> }, 15000, 15);
> assertTrue("The rehash listener thread should be different rather than the current.", Thread.currentThread() != listenerNode1.threadRunningNotif);
> assertTrue("The topology should be changed so far on node1.", listenerNode1.isTopologyChanged);
> assertTrue("The topology should be changed with different thread rather than this one on node1.", listenerNode1.topologyThreadRunningNotif != Thread.currentThread());
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months