Hi, It is possible, you put too few data that belongs to 2 partitions (total partition is 1024 by default) and after restart you got different partition distribution for 2 nodes. Please take a look at how affinity function works [1].
[1] https://apacheignite.readme.io/docs/affinity-collocation#section-affinity-function On Sun, May 20, 2018 at 5:39 PM, Вадим Васюк <[email protected]> wrote: > Hi All, > > I have a 2 server nodes (with persistence enabled) and one client node > started on my PC. > From client I activate cluster and then create a simple cache with below > configuration and add 10 entries to it: > > CacheConfiguration<Integer, String> cfg = new CacheConfiguration<>(); > cfg.setName(C); > cfg.setBackups(1); > cfg.setRebalanceDelay(1000L); > cfg.setCacheMode(CacheMode.PARTITIONED); > cfg.setAtomicityMode(CacheAtomicityMode.ATOMIC); > cfg.setRebalanceMode(CacheRebalanceMode.SYNC); > IgniteCache cache = ignite.getOrCreateCache(cfg); > > IntStream.range(cache.size(CachePeekMode.ALL)+1, > cache.size(CachePeekMode.ALL)+1+10).forEach(i -> { > cache.put(i, Utils.getRandonString(2)); > } > ); > > I have a simple computation task to check which entry went to which server > and here is the output after I inserted data into the cache: > server name: 544a56b3-1364-420e-bdbb-380a1460df72 cache entries: > 1,2,4,5,7,8 backup entries: 3,6,9,10 > server name: eb630559-c6b4-46a4-a98b-3ba2abfefce9 cache entries: > 3,6,9,10 backup entries: 1,2,4,5,7,8 > > As you can see all entries are saved and have backups on each other nodes. > > However after I restart one of these server nodes, I can see such data > distribution: > server name: eb630559-c6b4-46a4-a98b-3ba2abfefce9 cache entries: > 1,2,3,4,5,6,7,8,9,10 backup entries: > server name: 544a56b3-1364-420e-bdbb-380a1460df72 cache entries: > backup entries: 1,2,3,4,5,6,7,8,9,10 > > As you can see data after one node restart is no longer distributed nicely. > And from this moment I cannot make it redistribute. > > Could you please advice what I may be doing wrong? > > Thanks for your reply. > > > -- > Sincerely Yours > Vadim Vasyuk > -- Best regards, Andrey V. Mashenkov
