Re: Reassign partitions

2016-09-23 Thread vkulichenko
Hi Alex,

I ran your example and now understand what you were talking about. I don't
think there is an easy way to solve this. I think you should load the data
using loadCache method making sure that this is done on consistent topology
which should be the same as when the cluster was stopped.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7935.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-15 Thread wetnose
Hi Val,

Did you look at my example? It there a mistake in the Ignite configuration
or in the steps I did?

-Alex



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7760.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-10 Thread wetnose
Hi,

I've created a test project for you
https://dl.dropboxusercontent.com/u/46370629/localstore-example.zip

Please, find readme.txt in the archive.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7659.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-09 Thread wetnose
Hi,

In my example Ignite moves entries that a loaded from the local store to the
cache. If an entry is not loaded yet then it will not be moved to the new
node and potentially will be lost.

I will prepare an example for you to demonstrate the problem.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7637.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-08 Thread vkulichenko
Hi,

I don't understand. In your example part.2 was moved from Node1 to Node3. So
all the entries will be moved to Node3 and the local store will be update as
well. What is lost?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7620.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-07 Thread wetnose
Hi,

Look at the following list of steps

* Create a cache "X" with 3 partitions and 1 backup, configure a local store
* Start Node1 and Node2, the affinity function assigns nodes as follows
part.0: Node1 (prim) Node2 (back)
part.1: Node2 (prim) Node1 (back)
part.2: Node1 (prim) Node2 (back)
  so, Node1 is primary for partitions 0 and 2
* Put sveral records to the cache: all of them are written to the local
store on both nodes (because any node is primary or backaup for each
partition)
* Stop all the nodes
* Start them again: the memory on both nodes is empty, nothing is preloaded
(record are not read from the local stores yet)
* Start Node3 and let AffinityFunction mark Node3 as primary for partition 2
(leave the backup on Node2)
* Iginte (if lateAffAssignment=true) keeps Node1 as primary when
rebalancing: it moves entries from the memory of Node1 to the memory (and to
the local store) of Node3
part.0: Node1 (prim) Node2 (back)
part.1: Node2 (prim) Node1 (back)
part.2: Node1 (prim) Node3 (back) Node2 (back)
* Since all records from memory (!) are moved, Ignite stops the balancing
and restores the "ideal assignment": it replaces Node1 with Node3
part.0: Node1 (prim) Node2 (back)
part.1: Node2 (prim) Node1 (back)
part.2: Node3 (prim) Node2 (back)
* Now Node3 contains records that were moved from the memory of Node1, but
other records in the Node1's store (for part.2) where ignored and lost.

Where I made a mistake?

What I want to do is to delay the ideal assignment restoring until the local
store of the "primary node candidate" is completely synchronized with the
local store of the current primary node (somehow).

Is there a way to avoid the data loss when changing the cluster topology
(with local stores)?



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7597.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-06 Thread vkulichenko
AffinityFunction has to return the same result for the same topology anyway,
this is the crucial contract. Having said that, I still don't understand how
calling it at a random moment of time will help.

Do you have a test project that you can share with us? This would make
things more clear.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7570.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-04 Thread wetnose
AffinityFunction is called only if a server node joins of leaves the
topology. But I cannot make Ignite call it at any time.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7524.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-04 Thread wetnose
If I add a new node to a cluster I want to be able to move some cache
partitions to it. The node is empty and its storage has no records. Ignite
can move a partition with all loaded entries to the new node and write these
entries to the node's storage. But enries that are not loaded are ignored. I
didn't find a way to  synchronize the new local storage with the existing
one, which is required if I want to move the primary partition to the new
node. Ignite completes the topology migration as soon as node memories are
synchronized. But in the case with local storages it is wrong behaviour: we
should still synchronize storages.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7523.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-02 Thread vkulichenko
Local store writes on both primary and backups. So you should be able to
recover the data even if the topology was changing. Can you clarify what the
issue is? How partition assignment will help you?

Basically, you can implement AffinityFunction interface and implement your
own assignment logic there.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7508.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-01 Thread wetnose
Hi,

We have no global DB behind the grid. We marked our Store with
@CacheLocalStore annotation. But Ignite does not move stored entries when
rebalancig partitions. So we should have more control of partition
assignment to be able to change the assignment manually after storage
synchronization.



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7468.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Reassign partitions

2016-09-01 Thread vkulichenko
Hi,

Can you please clarify why would you need this?

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Reassign-partitions-tp7461p7464.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.