You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by kotamrajuyashasvi <ko...@gmail.com> on 2018/08/23 09:14:12 UTC

Ignite default partition to node mapping is not balanced

Hi

I'm working on an Ignite project where all the data is partitioned based on
field partition-id and it is set
as affinitykeyfield. We are running 5 ignite servers on 5 machines which
have identical hardware and ignite heap settings/java options. Our data has
overall 5 partition-ids(1-5) . But when we insert same number of records for
each partition id the data is not spreading equally among all ignite
servers. For example when we insert 5 records of each with partition id 1-5
, Its expected that each server node has one record. But the distribution is
different. I used Affinity.mapPartitionToNode() function to see how
partitions are mapped to nodes and we see the following mapping:

partiton-id : 1  [192.168.10.155]
partiton-id : 2  [192.168.10.155]
partiton-id : 3  [192.168.10.155]
partiton-id : 4  [192.168.10.153]
partiton-id : 5  [192.168.10.155]

And our ignite server nodes are : 
1. 192.168.10.152 
2. 192.168.10.153 
3. 192.168.10.154 
4. 192.168.10.155 
5. 192.168.10.157

We even changed the number of partitions as 5 using
RendezvousAffinityFunction 
But still the partition to node mapping was exactly same as without
RendezvousAffinityFunction(the above mapping). 

Our data is almost evenly distributed among the partition ids hence we
require even partition to node distribution. How can we achieve that ? We do
not want to mess with any ignite default properties except the partition to
node mapping. We will also be using backups. Also why is the default
partition to node mapping not balanced ?    





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite default partition to node mapping is not balanced

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

It was removed as part of https://issues.apache.org/jira/browse/IGNITE-3477

Regards,
-- 
Ilya Kasnacheev


вт, 23 окт. 2018 г. в 14:46, kotamrajuyashasvi <kotamrajuyashasvi@gmail.com
>:

> Hi
>
> can you provide more info on why fair affinity was removed . If its not a
> critical problem and can compromise on we would like to use it.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Ignite default partition to node mapping is not balanced

Posted by kotamrajuyashasvi <ko...@gmail.com>.
Hi

can you provide more info on why fair affinity was removed . If its not a
critical problem and can compromise on we would like to use it.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite default partition to node mapping is not balanced

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

No, it is not possible. There was Fair Affinity in 1.x which tried to do
that, but had other problems. When using Rendezvous affinity, the
distribution will always be somewhat random.

Regards,
-- 
Ilya Kasnacheev


пн, 22 окт. 2018 г. в 17:06, kotamrajuyashasvi <kotamrajuyashasvi@gmail.com
>:

> Hi
>
> Apart from writing whole new affinity function plugin, is it possible to
> tweak the hash function in Rendezvous function/default affinity function to
> make a balanced partition to node mapping. without affecting the
> redistribution scenarios of main and backup partitions.
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Ignite default partition to node mapping is not balanced

Posted by kotamrajuyashasvi <ko...@gmail.com>.
Hi

Apart from writing whole new affinity function plugin, is it possible to
tweak the hash function in Rendezvous function/default affinity function to
make a balanced partition to node mapping. without affecting the
redistribution scenarios of main and backup partitions.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite default partition to node mapping is not balanced

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

It is a pseudo-random function based on consistentId. Maybe you have
consistentId specified for your nodes (or for some reason they are the same
anyway). Theoretically you could heuristically pick consistentIds for nodes
for better distribution.

I don't think you can work around Rendezvous function if you have small
number of partitions. I can only recommend implementing your own affinity
function.

Regards,

-- 
Ilya Kasnacheev

2018-08-23 13:12 GMT+03:00 kotamrajuyashasvi <ko...@gmail.com>:

> Hi
>
> We are not running with ignite persistence.
> Also we observed that for a given ignite nodes the partition to node
> mapping
> is always same using RendezvousAffinityFunction or not or how many times we
> restart the cluster. How can we say its random ?
>
> I would like to know what is the solution to this problem given we use only
> less number of partitions ?
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Re: Ignite default partition to node mapping is not balanced

Posted by kotamrajuyashasvi <ko...@gmail.com>.
Hi

We are not running with ignite persistence.
Also we observed that for a given ignite nodes the partition to node mapping
is always same using RendezvousAffinityFunction or not or how many times we
restart the cluster. How can we say its random ?

I would like to know what is the solution to this problem given we use only
less number of partitions ?



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite default partition to node mapping is not balanced

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

If you would read on the Rendezvous algorithm you will notice that it is
essentially random-based. Balanced distribution is only attained by having
a large number of partitions, which would even-out the randomness.

Also, if all of your partitions map to the same nodes, you should check
your cluster's baseline (if running with persistence). It is possible that
not all nodes are in baseline.

Regards,

-- 
Ilya Kasnacheev

2018-08-23 12:14 GMT+03:00 kotamrajuyashasvi <ko...@gmail.com>:

> Hi
>
> I'm working on an Ignite project where all the data is partitioned based on
> field partition-id and it is set
> as affinitykeyfield. We are running 5 ignite servers on 5 machines which
> have identical hardware and ignite heap settings/java options. Our data has
> overall 5 partition-ids(1-5) . But when we insert same number of records
> for
> each partition id the data is not spreading equally among all ignite
> servers. For example when we insert 5 records of each with partition id 1-5
> , Its expected that each server node has one record. But the distribution
> is
> different. I used Affinity.mapPartitionToNode() function to see how
> partitions are mapped to nodes and we see the following mapping:
>
> partiton-id : 1  [192.168.10.155]
> partiton-id : 2  [192.168.10.155]
> partiton-id : 3  [192.168.10.155]
> partiton-id : 4  [192.168.10.153]
> partiton-id : 5  [192.168.10.155]
>
> And our ignite server nodes are :
> 1. 192.168.10.152
> 2. 192.168.10.153
> 3. 192.168.10.154
> 4. 192.168.10.155
> 5. 192.168.10.157
>
> We even changed the number of partitions as 5 using
> RendezvousAffinityFunction
> But still the partition to node mapping was exactly same as without
> RendezvousAffinityFunction(the above mapping).
>
> Our data is almost evenly distributed among the partition ids hence we
> require even partition to node distribution. How can we achieve that ? We
> do
> not want to mess with any ignite default properties except the partition to
> node mapping. We will also be using backups. Also why is the default
> partition to node mapping not balanced ?
>
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>