apache / ignite

Apache Ignite
https://ignite.apache.org/
Apache License 2.0
4.78k stars 1.9k forks source link

Ignite Eviction is not working with Cache Mode as Atomic #10855

Open kagrawal-tibco opened 1 year ago

kagrawal-tibco commented 1 year ago

We are using ignite cache and cluster with various configurations. The entity cache with Cache configuration as Atomic is not evicting data but behaving as unlimited cache. The same is working for Transactional mode. We have configured eviction at the data region: level DataRegionConfiguration drc = new DataRegionConfiguration(); drc.setInitialSize(Math.round((long)Math.max(bytesMaxSize/2,BYTES_10MB))); drc.setMaxSize(bytesMaxSize); drc.setPageEvictionMode(DataPageEvictionMode.RANDOM_2_LRU); drc.setName(regionName); drc.setPersistenceEnabled(isSharedNothing);

    cfg.setStoreKeepBinary(true);
    cfg.setCacheMode(CacheMode.PARTITIONED);
    cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
    cfg.setName(name);
kagrawal-tibco commented 10 months ago

Can you please update on it?

timoninmaxim commented 10 months ago

Hi @kagrawal-tibco !

Which behavior do you expect? DataPageEvictionMode works when persistent is disabled. Which value of the isSharedNothing flag?

kagrawal-tibco commented 9 months ago

Hi @timoninmaxim thank you for your response! I think the issue is with putAll operation with eviction. We are using putall method similar to issue

https://issues.apache.org/jira/browse/IGNITE-8917. So is it resolved or any work around as using put instead of putall is very costly ?

AS I tried using batches but that is not working properly. I used batch size formula using threshold and max and initial size but it only work for limited cache sizes kept as initial size from 10 to 15 MB and max sizes to 15 to 25 MB. which is very strange.

Batch formula : batchsize = (int) (((Maxsize-initial size) (1 - dataRegionThreashod)) / (entrySizeInbytes 2));

kagrawal-tibco commented 8 months ago

Hi @timoninmaxim Any update on this please?

timoninmaxim commented 8 months ago

Hi @kagrawal-tibco !

You didn't answer for the questions, which value of the isSharedNothing flag in your example. If it's set to true then page eviction is disabled and entries are stored on disk instead. It can look like cache is unlimited.

DataRegionConfiguration#setMaxSize limits only size used by Ignite on RAM, but not on disk.

Do you have the same behavior as described in the ticket IGNITE-8917 - OutOfMemory error?

Could you please attach a reproducer of your problem?

kagrawal-tibco commented 8 months ago

HI @timoninmaxim The isSharedNothing is false .The cache is limited i checked . Yes the behavior is same as described in ticket and getting same igniteOutOfMemory exception. This the modified ignite example where if put is used everything works fine but if we use putAll it breaks CacheTransactionExample.zip

kagrawal-tibco commented 8 months ago

HI @timoninmaxim Any update on this?