Search code examples
ignite

Is there a way of shuffling partition data on Apache Ignite?


I've got a question that is related to data repartitioning. Suppose there's a cache with a pre-defined affinity key. Assume I need to repartition data with a new affinity key. I'm wondering whether there is a way of shuffling partition data across all nodes by a new affinity key?


Solution

  • You need to repopulate the data in that case.

    • First, it's a static configuration and can't be changed on the fly.
    • The second, most likely you will need to clear meta-information for that particular type, i.e. clean work/binary_meta folder.
    • The last one - once you changed it, you won't be able to locate the data since most likely it will be stored in a different partition.

    In other words, say, you had a cache key with two fields A and B: K(A,B) where A is your affinity key. Say, your Key(1,2) was mapped to a partition 5. In that case, to locate the value, Ignite will search for this partition 5 depending on which node hold the primary copy of it. Later you wanted to have B as the affinity key and re-configure the cache accordingly. In that case, Key(1,2) might now be mapped to a partition 780, meaning that Ignite will never search for a partition 5 and won't be able to locate the previous data.