You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by abraham <a....@qriously.com> on 2016/05/10 06:26:15 UTC

Eviction Events with offheap values

Hi, 

I am re-posting an earlier message to which I did not get any replies
because I was not subscribed to the mailing list:

I am trying to get the values from the eviction events. This works fine with
the ONHEAP_TIERED version but not with OFFHEAP_VALUES and OFFHEAP_TIERED -
in that cases the hasOldValue is true but the actual value is null. 

What we are trying to accomplish is to persist entries to a database only
when they either get removed, expired or evicted because the max cache size
is reached and it looks like those events are the only way to accomplish
this. 

A quick glance at the code would suggest that in the
org.apache.ignite.internal.processors.cache.GridCacheEvictionManager one
could replace line 708 from 

CacheObject oldVal = recordable ? entry.rawGet() : null; 

to 

CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) : null; 

to get the values attached to the events. Would that work? 

Thanks, 

Abraham



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Eviction Events with offheap values

Posted by Andrey Gura <ag...@gridgain.com>.
I don't think that evicition from offheap to swap should fire
EVT_CACHE_OBJECT_EXPIRED event because it will indistinguishable from
normal eviction event.

On Fri, May 20, 2016 at 3:06 AM, Dmitriy Setrakyan <ds...@apache.org>
wrote:

> Andrey, I think there should be an eviction event fired, no? Can you please
> file a ticket on it?
>
> Thanks,
> D.
>
> On Wed, May 18, 2016 at 10:16 AM, Andrey Gura <ag...@gridgain.com> wrote:
>
> > As I can see from GridCacheSwapManager code Ignite doesn't fire eviction
> > events from offheap.
> >
> > On offheap evict GridCacheSwapManager does teh following:
> >
> > 1. Updates onOffheapEvict metric if enabled
> > 2. Fires EVT_CACHE_OBJECT_SWAPPED event if swap enabled.
> >
> > On Tue, May 17, 2016 at 3:44 AM, Dmitriy Setrakyan <
> dsetrakyan@apache.org>
> > wrote:
> >
> > > Guys,
> > >
> > > Resending this question to the dev list. Doesn’t Ignite fire an
> eviction
> > > event whenever an entry is evicted from off-heap memory?
> > >
> > > D.
> > >
> > > ---------- Forwarded message ----------
> > > From: Alexei Scherbakov <al...@gmail.com>
> > > Date: Mon, May 16, 2016 at 1:33 AM
> > > Subject: Re: Eviction Events with offheap values
> > > To: user@ignite.apache.org
> > >
> > >
> > > Andrey, thanks for the clarification.
> > >
> > > Abraham, it seems EvictionPolicy is not appropriate solution for your
> > case.
> > > BTW, why user session expiration logic is related to cache size ?
> > > In case user sessions expire by timeout the more appropriate solution
> > would
> > > be listening to
> > > EVT_CACHE_OBJECT_EXPIRED event.
> > > You can also set eager expiration by calling
> > > CacheConfiguration.setEagerTtl(true)
> > > to make Ignite expire values automatically.
> > >
> > > Did this help?
> > >
> > >
> > > 2016-05-13 19:49 GMT+03:00 Andrey Gura <ag...@gridgain.com>:
> > >
> > > > Alexei, Abraham,
> > > >
> > > > Eviction policy configuration doesn't make sense for OFFHEAP_TIERED
> > mode.
> > > > Eviction policy works only for on heap entries in order to evict
> > entries
> > > to
> > > > offheap.
> > > >
> > > > For eviction of entries from offheap memory Ignite internaly uses
> other
> > > > LRU eviction policy and there is no way to change this behaviour via
> > > > configuration.
> > > >
> > > > On Thu, May 12, 2016 at 7:14 PM, Alexei Scherbakov <
> > > > alexey.scherbakoff@gmail.com> wrote:
> > > >
> > > >> Hi,
> > > >>
> > > >> I was not able to reproduce your case.
> > > >> In my test I have correct old value on eviction event.
> > > >> Please provide a reproducer.
> > > >>
> > > >> BTW: what are you trying to accomplish? Generally events are not
> very
> > > >> good for cluster performance and may not be delivered in case of the
> > > >> listener node failure.
> > > >>
> > > >> 2016-05-10 9:26 GMT+03:00 abraham <a....@qriously.com>:
> > > >>
> > > >>> Hi,
> > > >>>
> > > >>> I am re-posting an earlier message to which I did not get any
> replies
> > > >>> because I was not subscribed to the mailing list:
> > > >>>
> > > >>> I am trying to get the values from the eviction events. This works
> > fine
> > > >>> with
> > > >>> the ONHEAP_TIERED version but not with OFFHEAP_VALUES and
> > > OFFHEAP_TIERED
> > > >>> -
> > > >>> in that cases the hasOldValue is true but the actual value is null.
> > > >>>
> > > >>> What we are trying to accomplish is to persist entries to a
> database
> > > only
> > > >>> when they either get removed, expired or evicted because the max
> > cache
> > > >>> size
> > > >>> is reached and it looks like those events are the only way to
> > > accomplish
> > > >>> this.
> > > >>>
> > > >>> A quick glance at the code would suggest that in the
> > > >>>
> org.apache.ignite.internal.processors.cache.GridCacheEvictionManager
> > > one
> > > >>> could replace line 708 from
> > > >>>
> > > >>> CacheObject oldVal = recordable ? entry.rawGet() : null;
> > > >>>
> > > >>> to
> > > >>>
> > > >>> CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) :
> > > null;
> > > >>>
> > > >>> to get the values attached to the events. Would that work?
> > > >>>
> > > >>> Thanks,
> > > >>>
> > > >>> Abraham
> > > >>>
> > > >>>
> > > >>>
> > > >>> --
> > > >>> View this message in context:
> > > >>>
> > >
> >
> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
> > > >>> Sent from the Apache Ignite Users mailing list archive at
> Nabble.com.
> > > >>>
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >>
> > > >> Best regards,
> > > >> Alexei Scherbakov
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > Andrey Gura
> > > > GridGain Systems, Inc.
> > > > www.gridgain.com
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > Best regards,
> > > Alexei Scherbakov
> > >
> >
> >
> >
> > --
> > Andrey Gura
> > GridGain Systems, Inc.
> > www.gridgain.com
> >
>



-- 
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com

Re: Eviction Events with offheap values

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Andrey, I think there should be an eviction event fired, no? Can you please
file a ticket on it?

Thanks,
D.

On Wed, May 18, 2016 at 10:16 AM, Andrey Gura <ag...@gridgain.com> wrote:

> As I can see from GridCacheSwapManager code Ignite doesn't fire eviction
> events from offheap.
>
> On offheap evict GridCacheSwapManager does teh following:
>
> 1. Updates onOffheapEvict metric if enabled
> 2. Fires EVT_CACHE_OBJECT_SWAPPED event if swap enabled.
>
> On Tue, May 17, 2016 at 3:44 AM, Dmitriy Setrakyan <ds...@apache.org>
> wrote:
>
> > Guys,
> >
> > Resending this question to the dev list. Doesn’t Ignite fire an eviction
> > event whenever an entry is evicted from off-heap memory?
> >
> > D.
> >
> > ---------- Forwarded message ----------
> > From: Alexei Scherbakov <al...@gmail.com>
> > Date: Mon, May 16, 2016 at 1:33 AM
> > Subject: Re: Eviction Events with offheap values
> > To: user@ignite.apache.org
> >
> >
> > Andrey, thanks for the clarification.
> >
> > Abraham, it seems EvictionPolicy is not appropriate solution for your
> case.
> > BTW, why user session expiration logic is related to cache size ?
> > In case user sessions expire by timeout the more appropriate solution
> would
> > be listening to
> > EVT_CACHE_OBJECT_EXPIRED event.
> > You can also set eager expiration by calling
> > CacheConfiguration.setEagerTtl(true)
> > to make Ignite expire values automatically.
> >
> > Did this help?
> >
> >
> > 2016-05-13 19:49 GMT+03:00 Andrey Gura <ag...@gridgain.com>:
> >
> > > Alexei, Abraham,
> > >
> > > Eviction policy configuration doesn't make sense for OFFHEAP_TIERED
> mode.
> > > Eviction policy works only for on heap entries in order to evict
> entries
> > to
> > > offheap.
> > >
> > > For eviction of entries from offheap memory Ignite internaly uses other
> > > LRU eviction policy and there is no way to change this behaviour via
> > > configuration.
> > >
> > > On Thu, May 12, 2016 at 7:14 PM, Alexei Scherbakov <
> > > alexey.scherbakoff@gmail.com> wrote:
> > >
> > >> Hi,
> > >>
> > >> I was not able to reproduce your case.
> > >> In my test I have correct old value on eviction event.
> > >> Please provide a reproducer.
> > >>
> > >> BTW: what are you trying to accomplish? Generally events are not very
> > >> good for cluster performance and may not be delivered in case of the
> > >> listener node failure.
> > >>
> > >> 2016-05-10 9:26 GMT+03:00 abraham <a....@qriously.com>:
> > >>
> > >>> Hi,
> > >>>
> > >>> I am re-posting an earlier message to which I did not get any replies
> > >>> because I was not subscribed to the mailing list:
> > >>>
> > >>> I am trying to get the values from the eviction events. This works
> fine
> > >>> with
> > >>> the ONHEAP_TIERED version but not with OFFHEAP_VALUES and
> > OFFHEAP_TIERED
> > >>> -
> > >>> in that cases the hasOldValue is true but the actual value is null.
> > >>>
> > >>> What we are trying to accomplish is to persist entries to a database
> > only
> > >>> when they either get removed, expired or evicted because the max
> cache
> > >>> size
> > >>> is reached and it looks like those events are the only way to
> > accomplish
> > >>> this.
> > >>>
> > >>> A quick glance at the code would suggest that in the
> > >>> org.apache.ignite.internal.processors.cache.GridCacheEvictionManager
> > one
> > >>> could replace line 708 from
> > >>>
> > >>> CacheObject oldVal = recordable ? entry.rawGet() : null;
> > >>>
> > >>> to
> > >>>
> > >>> CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) :
> > null;
> > >>>
> > >>> to get the values attached to the events. Would that work?
> > >>>
> > >>> Thanks,
> > >>>
> > >>> Abraham
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> View this message in context:
> > >>>
> >
> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
> > >>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
> > >>>
> > >>
> > >>
> > >>
> > >> --
> > >>
> > >> Best regards,
> > >> Alexei Scherbakov
> > >>
> > >
> > >
> > >
> > > --
> > > Andrey Gura
> > > GridGain Systems, Inc.
> > > www.gridgain.com
> > >
> >
> >
> >
> > --
> >
> > Best regards,
> > Alexei Scherbakov
> >
>
>
>
> --
> Andrey Gura
> GridGain Systems, Inc.
> www.gridgain.com
>

Re: Eviction Events with offheap values

Posted by Andrey Gura <ag...@gridgain.com>.
As I can see from GridCacheSwapManager code Ignite doesn't fire eviction
events from offheap.

On offheap evict GridCacheSwapManager does teh following:

1. Updates onOffheapEvict metric if enabled
2. Fires EVT_CACHE_OBJECT_SWAPPED event if swap enabled.

On Tue, May 17, 2016 at 3:44 AM, Dmitriy Setrakyan <ds...@apache.org>
wrote:

> Guys,
>
> Resending this question to the dev list. Doesn’t Ignite fire an eviction
> event whenever an entry is evicted from off-heap memory?
>
> D.
>
> ---------- Forwarded message ----------
> From: Alexei Scherbakov <al...@gmail.com>
> Date: Mon, May 16, 2016 at 1:33 AM
> Subject: Re: Eviction Events with offheap values
> To: user@ignite.apache.org
>
>
> Andrey, thanks for the clarification.
>
> Abraham, it seems EvictionPolicy is not appropriate solution for your case.
> BTW, why user session expiration logic is related to cache size ?
> In case user sessions expire by timeout the more appropriate solution would
> be listening to
> EVT_CACHE_OBJECT_EXPIRED event.
> You can also set eager expiration by calling
> CacheConfiguration.setEagerTtl(true)
> to make Ignite expire values automatically.
>
> Did this help?
>
>
> 2016-05-13 19:49 GMT+03:00 Andrey Gura <ag...@gridgain.com>:
>
> > Alexei, Abraham,
> >
> > Eviction policy configuration doesn't make sense for OFFHEAP_TIERED mode.
> > Eviction policy works only for on heap entries in order to evict entries
> to
> > offheap.
> >
> > For eviction of entries from offheap memory Ignite internaly uses other
> > LRU eviction policy and there is no way to change this behaviour via
> > configuration.
> >
> > On Thu, May 12, 2016 at 7:14 PM, Alexei Scherbakov <
> > alexey.scherbakoff@gmail.com> wrote:
> >
> >> Hi,
> >>
> >> I was not able to reproduce your case.
> >> In my test I have correct old value on eviction event.
> >> Please provide a reproducer.
> >>
> >> BTW: what are you trying to accomplish? Generally events are not very
> >> good for cluster performance and may not be delivered in case of the
> >> listener node failure.
> >>
> >> 2016-05-10 9:26 GMT+03:00 abraham <a....@qriously.com>:
> >>
> >>> Hi,
> >>>
> >>> I am re-posting an earlier message to which I did not get any replies
> >>> because I was not subscribed to the mailing list:
> >>>
> >>> I am trying to get the values from the eviction events. This works fine
> >>> with
> >>> the ONHEAP_TIERED version but not with OFFHEAP_VALUES and
> OFFHEAP_TIERED
> >>> -
> >>> in that cases the hasOldValue is true but the actual value is null.
> >>>
> >>> What we are trying to accomplish is to persist entries to a database
> only
> >>> when they either get removed, expired or evicted because the max cache
> >>> size
> >>> is reached and it looks like those events are the only way to
> accomplish
> >>> this.
> >>>
> >>> A quick glance at the code would suggest that in the
> >>> org.apache.ignite.internal.processors.cache.GridCacheEvictionManager
> one
> >>> could replace line 708 from
> >>>
> >>> CacheObject oldVal = recordable ? entry.rawGet() : null;
> >>>
> >>> to
> >>>
> >>> CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) :
> null;
> >>>
> >>> to get the values attached to the events. Would that work?
> >>>
> >>> Thanks,
> >>>
> >>> Abraham
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
> >>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
> >>>
> >>
> >>
> >>
> >> --
> >>
> >> Best regards,
> >> Alexei Scherbakov
> >>
> >
> >
> >
> > --
> > Andrey Gura
> > GridGain Systems, Inc.
> > www.gridgain.com
> >
>
>
>
> --
>
> Best regards,
> Alexei Scherbakov
>



-- 
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com

Fwd: Eviction Events with offheap values

Posted by Dmitriy Setrakyan <ds...@apache.org>.
Guys,

Resending this question to the dev list. Doesn’t Ignite fire an eviction
event whenever an entry is evicted from off-heap memory?

D.

---------- Forwarded message ----------
From: Alexei Scherbakov <al...@gmail.com>
Date: Mon, May 16, 2016 at 1:33 AM
Subject: Re: Eviction Events with offheap values
To: user@ignite.apache.org


Andrey, thanks for the clarification.

Abraham, it seems EvictionPolicy is not appropriate solution for your case.
BTW, why user session expiration logic is related to cache size ?
In case user sessions expire by timeout the more appropriate solution would
be listening to
EVT_CACHE_OBJECT_EXPIRED event.
You can also set eager expiration by calling
CacheConfiguration.setEagerTtl(true)
to make Ignite expire values automatically.

Did this help?


2016-05-13 19:49 GMT+03:00 Andrey Gura <ag...@gridgain.com>:

> Alexei, Abraham,
>
> Eviction policy configuration doesn't make sense for OFFHEAP_TIERED mode.
> Eviction policy works only for on heap entries in order to evict entries to
> offheap.
>
> For eviction of entries from offheap memory Ignite internaly uses other
> LRU eviction policy and there is no way to change this behaviour via
> configuration.
>
> On Thu, May 12, 2016 at 7:14 PM, Alexei Scherbakov <
> alexey.scherbakoff@gmail.com> wrote:
>
>> Hi,
>>
>> I was not able to reproduce your case.
>> In my test I have correct old value on eviction event.
>> Please provide a reproducer.
>>
>> BTW: what are you trying to accomplish? Generally events are not very
>> good for cluster performance and may not be delivered in case of the
>> listener node failure.
>>
>> 2016-05-10 9:26 GMT+03:00 abraham <a....@qriously.com>:
>>
>>> Hi,
>>>
>>> I am re-posting an earlier message to which I did not get any replies
>>> because I was not subscribed to the mailing list:
>>>
>>> I am trying to get the values from the eviction events. This works fine
>>> with
>>> the ONHEAP_TIERED version but not with OFFHEAP_VALUES and OFFHEAP_TIERED
>>> -
>>> in that cases the hasOldValue is true but the actual value is null.
>>>
>>> What we are trying to accomplish is to persist entries to a database only
>>> when they either get removed, expired or evicted because the max cache
>>> size
>>> is reached and it looks like those events are the only way to accomplish
>>> this.
>>>
>>> A quick glance at the code would suggest that in the
>>> org.apache.ignite.internal.processors.cache.GridCacheEvictionManager one
>>> could replace line 708 from
>>>
>>> CacheObject oldVal = recordable ? entry.rawGet() : null;
>>>
>>> to
>>>
>>> CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) : null;
>>>
>>> to get the values attached to the events. Would that work?
>>>
>>> Thanks,
>>>
>>> Abraham
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>>
>> Best regards,
>> Alexei Scherbakov
>>
>
>
>
> --
> Andrey Gura
> GridGain Systems, Inc.
> www.gridgain.com
>



-- 

Best regards,
Alexei Scherbakov

Re: Eviction Events with offheap values

Posted by Alexei Scherbakov <al...@gmail.com>.
Andrey, thanks for the clarification.

Abraham, it seems EvictionPolicy is not appropriate solution for your case.
BTW, why user session expiration logic is related to cache size ?
In case user sessions expire by timeout the more appropriate solution would
be listening to
EVT_CACHE_OBJECT_EXPIRED event.
You can also set eager expiration by calling
CacheConfiguration.setEagerTtl(true)
to make Ignite expire values automatically.

Did this help?


2016-05-13 19:49 GMT+03:00 Andrey Gura <ag...@gridgain.com>:

> Alexei, Abraham,
>
> Eviction policy configuration doesn't make sense for OFFHEAP_TIERED mode.
> Eviction policy works only for on heap entries in order to evict entries to
> offheap.
>
> For eviction of entries from offheap memory Ignite internaly uses other
> LRU eviction policy and there is no way to change this behaviour via
> configuration.
>
> On Thu, May 12, 2016 at 7:14 PM, Alexei Scherbakov <
> alexey.scherbakoff@gmail.com> wrote:
>
>> Hi,
>>
>> I was not able to reproduce your case.
>> In my test I have correct old value on eviction event.
>> Please provide a reproducer.
>>
>> BTW: what are you trying to accomplish? Generally events are not very
>> good for cluster performance and may not be delivered in case of the
>> listener node failure.
>>
>> 2016-05-10 9:26 GMT+03:00 abraham <a....@qriously.com>:
>>
>>> Hi,
>>>
>>> I am re-posting an earlier message to which I did not get any replies
>>> because I was not subscribed to the mailing list:
>>>
>>> I am trying to get the values from the eviction events. This works fine
>>> with
>>> the ONHEAP_TIERED version but not with OFFHEAP_VALUES and OFFHEAP_TIERED
>>> -
>>> in that cases the hasOldValue is true but the actual value is null.
>>>
>>> What we are trying to accomplish is to persist entries to a database only
>>> when they either get removed, expired or evicted because the max cache
>>> size
>>> is reached and it looks like those events are the only way to accomplish
>>> this.
>>>
>>> A quick glance at the code would suggest that in the
>>> org.apache.ignite.internal.processors.cache.GridCacheEvictionManager one
>>> could replace line 708 from
>>>
>>> CacheObject oldVal = recordable ? entry.rawGet() : null;
>>>
>>> to
>>>
>>> CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) : null;
>>>
>>> to get the values attached to the events. Would that work?
>>>
>>> Thanks,
>>>
>>> Abraham
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
>>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>>
>>
>>
>>
>> --
>>
>> Best regards,
>> Alexei Scherbakov
>>
>
>
>
> --
> Andrey Gura
> GridGain Systems, Inc.
> www.gridgain.com
>



-- 

Best regards,
Alexei Scherbakov

Re: Eviction Events with offheap values

Posted by Andrey Gura <ag...@gridgain.com>.
Alexei, Abraham,

Eviction policy configuration doesn't make sense for OFFHEAP_TIERED mode.
Eviction policy works only for on heap entries in order to evict entries to
offheap.

For eviction of entries from offheap memory Ignite internaly uses other LRU
eviction policy and there is no way to change this behaviour via
configuration.

On Thu, May 12, 2016 at 7:14 PM, Alexei Scherbakov <
alexey.scherbakoff@gmail.com> wrote:

> Hi,
>
> I was not able to reproduce your case.
> In my test I have correct old value on eviction event.
> Please provide a reproducer.
>
> BTW: what are you trying to accomplish? Generally events are not very good
> for cluster performance and may not be delivered in case of the listener
> node failure.
>
> 2016-05-10 9:26 GMT+03:00 abraham <a....@qriously.com>:
>
>> Hi,
>>
>> I am re-posting an earlier message to which I did not get any replies
>> because I was not subscribed to the mailing list:
>>
>> I am trying to get the values from the eviction events. This works fine
>> with
>> the ONHEAP_TIERED version but not with OFFHEAP_VALUES and OFFHEAP_TIERED -
>> in that cases the hasOldValue is true but the actual value is null.
>>
>> What we are trying to accomplish is to persist entries to a database only
>> when they either get removed, expired or evicted because the max cache
>> size
>> is reached and it looks like those events are the only way to accomplish
>> this.
>>
>> A quick glance at the code would suggest that in the
>> org.apache.ignite.internal.processors.cache.GridCacheEvictionManager one
>> could replace line 708 from
>>
>> CacheObject oldVal = recordable ? entry.rawGet() : null;
>>
>> to
>>
>> CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) : null;
>>
>> to get the values attached to the events. Would that work?
>>
>> Thanks,
>>
>> Abraham
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>
>
> --
>
> Best regards,
> Alexei Scherbakov
>



-- 
Andrey Gura
GridGain Systems, Inc.
www.gridgain.com

Re: Eviction Events with offheap values

Posted by abraham <a....@qriously.com>.
Thanks Alexei,

that is very kind of you. Let me know if you need anything else from me on
this.

Best,

Abraham



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853p4933.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Eviction Events with offheap values

Posted by Alexei Scherbakov <al...@gmail.com>.
Hi Abraham,

Now I see.
I've created two issues related to your problem.
1) https://issues.apache.org/jira/browse/IGNITE-3134
2) https://issues.apache.org/jira/browse/IGNITE-3135

Will look at them next week.

2016-05-12 20:02 GMT+03:00 abraham <a....@qriously.com>:

> Hi Alexei,
>
> thanks for having a look at my issue.
>
> What I would like to accomplish: We have a cache where we update the
> entries
> a lot. Basically we cache a users session over the period he is active and
> do a lot of updates. Once the session is over we persist the user back to a
> database. I couldn't see how this can be achieved with the write-behind
> feature as we would have hundreds of writes per session to the database per
> user instead of one.
>
> We do get the values in the expired / removed events but not when they get
> evicted because the cache is full (LruEviction)
>
> I attached a maven project with a single test that fails with
> memoryMod=OFFHEAP_VALUES, but passes if you change this to ONHEAP_TIERED in
> the ignite-config.xml
>
>   amu-test.zip
> <http://apache-ignite-users.70518.x6.nabble.com/file/n4909/amu-test.zip>
>
>
> Thanks!
>
> Abraham
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853p4909.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 

Best regards,
Alexei Scherbakov

Re: Eviction Events with offheap values

Posted by abraham <a....@qriously.com>.
Hi Alexei,

thanks for having a look at my issue.

What I would like to accomplish: We have a cache where we update the entries
a lot. Basically we cache a users session over the period he is active and
do a lot of updates. Once the session is over we persist the user back to a
database. I couldn't see how this can be achieved with the write-behind
feature as we would have hundreds of writes per session to the database per
user instead of one.

We do get the values in the expired / removed events but not when they get
evicted because the cache is full (LruEviction)

I attached a maven project with a single test that fails with
memoryMod=OFFHEAP_VALUES, but passes if you change this to ONHEAP_TIERED in
the ignite-config.xml

  amu-test.zip
<http://apache-ignite-users.70518.x6.nabble.com/file/n4909/amu-test.zip>  


Thanks!

Abraham



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853p4909.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Eviction Events with offheap values

Posted by Alexei Scherbakov <al...@gmail.com>.
Hi,

I was not able to reproduce your case.
In my test I have correct old value on eviction event.
Please provide a reproducer.

BTW: what are you trying to accomplish? Generally events are not very good
for cluster performance and may not be delivered in case of the listener
node failure.

2016-05-10 9:26 GMT+03:00 abraham <a....@qriously.com>:

> Hi,
>
> I am re-posting an earlier message to which I did not get any replies
> because I was not subscribed to the mailing list:
>
> I am trying to get the values from the eviction events. This works fine
> with
> the ONHEAP_TIERED version but not with OFFHEAP_VALUES and OFFHEAP_TIERED -
> in that cases the hasOldValue is true but the actual value is null.
>
> What we are trying to accomplish is to persist entries to a database only
> when they either get removed, expired or evicted because the max cache size
> is reached and it looks like those events are the only way to accomplish
> this.
>
> A quick glance at the code would suggest that in the
> org.apache.ignite.internal.processors.cache.GridCacheEvictionManager one
> could replace line 708 from
>
> CacheObject oldVal = recordable ? entry.rawGet() : null;
>
> to
>
> CacheObject oldVal = recordable ? entry.rawGetOrUnmarshal(false) : null;
>
> to get the values attached to the events. Would that work?
>
> Thanks,
>
> Abraham
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/Eviction-Events-with-offheap-values-tp4853.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>



-- 

Best regards,
Alexei Scherbakov