ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alper Tekinalp <al...@evam.com>
Subject Re: Same Affinity For Same Key On All Caches
Date Mon, 27 Feb 2017 15:44:05 GMT
Hi.

As I investigated the issue occurs when different nodes creates the caches.

Say I have 2 nodes node1 and node2 and 2 caches cache1 and cache2. If I
create cache1 on node1 and create cache2 on node2 with same
FairAffinityFunction with same partition size, keys can map different nodes
on different caches.

You can find my test code and resuts as attachment.

So is that a bug? Is there a way to force same mappings althought caches
created on different nodes?


On Fri, Feb 24, 2017 at 9:37 AM, Alper Tekinalp <alper@evam.com> wrote:

> Hi.
>
> Thanks for your comments. Let me investigate the issue deeper.
>
> Regards.
>
> On Thu, Feb 23, 2017 at 11:00 PM, Dmitriy Setrakyan <dsetrakyan@apache.org
> > wrote:
>
>> If you use the same (or default) configuration for the affinity, then the
>> same key in different caches will always end up on the same node. This is
>> guaranteed.
>>
>> D.
>>
>> On Thu, Feb 23, 2017 at 8:09 AM, Andrey Mashenkov <
>> andrey.mashenkov@gmail.com> wrote:
>>
>>> Val,
>>>
>>> Yes, with same affinity function entries with same key should be saved in
>>> same nodes.
>>> As far as I know, primary node is assinged automatically by Ignite. And
>>> I'm
>>> not sure that
>>> there is a guarantee that 2 entries from different caches with same key
>>> will have same primary and backup nodes.
>>> So, get operation for 1-st key can be local while get() for 2-nd key will
>>> be remote.
>>>
>>>
>>> On Thu, Feb 23, 2017 at 6:49 PM, Valentin Kulichenko <
>>> valentin.kulichenko@gmail.com> wrote:
>>>
>>> > Actually, this should work this way out of the box, as long as the same
>>> > affinity function is configured for all caches (that's true for default
>>> > settings).
>>> >
>>> > Andrey, am I missing something?
>>> >
>>> > -Val
>>> >
>>> > On Thu, Feb 23, 2017 at 7:02 AM, Andrey Mashenkov <
>>> > andrey.mashenkov@gmail.com> wrote:
>>> >
>>> > > Hi Alper,
>>> > >
>>> > > You can implement you own affinityFunction to achieve this.
>>> > > In AF you should implement 2 mappings: key to partition and
>>> partition to
>>> > > node.
>>> > >
>>> > > First mapping looks trivial, but second doesn't.
>>> > > Even if you will lucky to do it, there is no way to choose what node
>>> wil
>>> > be
>>> > > primary and what will be backup for a partition,
>>> > > that can be an issue.
>>> > >
>>> > >
>>> > > On Thu, Feb 23, 2017 at 10:44 AM, Alper Tekinalp <alper@evam.com>
>>> wrote:
>>> > >
>>> > > > Hi all.
>>> > > >
>>> > > > Is it possible to configures affinities in a way that partition
for
>>> > same
>>> > > > key will be on same node? So calling
>>> > > > ignite.affinity(CACHE).mapKeyToNode(KEY).id() with same key for
>>> any
>>> > > cache
>>> > > > will return same node id. Is that possible with a configuration
>>> etc.?
>>> > > >
>>> > > > --
>>> > > > Alper Tekinalp
>>> > > >
>>> > > > Software Developer
>>> > > > Evam Streaming Analytics
>>> > > >
>>> > > > Atatürk Mah. Turgut Özal Bulv.
>>> > > > Gardenya 5 Plaza K:6 Ataşehir
>>> > > > 34758 İSTANBUL
>>> > > >
>>> > > > Tel:  +90 216 455 01 53 Fax: +90 216 455 01 54
>>> > > > www.evam.com.tr
>>> > > > <http://www.evam.com>
>>> > > >
>>> > >
>>> > >
>>> > >
>>> > > --
>>> > > Best regards,
>>> > > Andrey V. Mashenkov
>>> > >
>>> >
>>>
>>>
>>>
>>> --
>>> Best regards,
>>> Andrey V. Mashenkov
>>>
>>
>>
>
>
> --
> Alper Tekinalp
>
> Software Developer
> Evam Streaming Analytics
>
> Atatürk Mah. Turgut Özal Bulv.
> Gardenya 5 Plaza K:6 Ataşehir
> 34758 İSTANBUL
>
> Tel:  +90 216 455 01 53 Fax: +90 216 455 01 54
> www.evam.com.tr
> <http://www.evam.com>
>



-- 
Alper Tekinalp

Software Developer
Evam Streaming Analytics

Atatürk Mah. Turgut Özal Bulv.
Gardenya 5 Plaza K:6 Ataşehir
34758 İSTANBUL

Tel:  +90 216 455 01 53 Fax: +90 216 455 01 54
www.evam.com.tr
<http://www.evam.com>

Mime
View raw message