Search code examples
ignitegridgain

Apache ignite Partition Map Exchange , Baseline Autoadjustment and Data Rebalancing


  1. My question is how these operations are related?
  2. are there events to capture start and end of PME(Partition Map Exchange) and Data rebalancing?

Solution

  • Long story short, these topics are about data distribution.

    Each node contains a predefined set of partitions where your actual caches reside. The number of partitions is fixed and is 1024 by default. That's said, if you had 2 nodes and a new one has been added, the data needs to be redistributed to the new one which means instead of having 1024/2 partitions on every node, it now needs to be 1024/3.

    The process of sending and receiving data due to topology changes is called data rebalancing. As you might expect, this process might be resource and time-consuming depending on the amount of data in your cluster. Sometimes a node might experience short outages, for example if there was an error or due to some maintenance works. In that case, when persistence is enabled and the data is being stored on disk, there is no need for 2 rebalances (when a node leave and when it's back), instead, we would like to avoid the rebalance. To achive that behavior, baseline topology has been introduced. Baseline topology might be confusing at first glance, but it defines a set of nodes that contains the data, every change in baseline will require data rebalance.

    When you add a new persistent node, it won't trigger a rebalance automatically, instead, you shoul include it into the baseline topology either manually, for example using the control script, or configuring Baseline Autoadjustment which means making baseline changes after some timeout. One the baseline is changed, the data is being redistributing.

    Befire data rebalancing starts, another process called Partition Map Exchange (PME) takes place. This is a cluster-wide process triggered when server or clent node joins or leaves the cluster or you are starting or destroying a cache. It's primary goal is to sync cluster information between all nodes and make some disitions like do we need to cancel some tasks (if a client failed), are there any partition lost (if no more partition owners left in the cluster) and so on.

    It's better to refer to the official documentation and blog posts for the details. Data Distribution in Apache Ignite

    Answering to the last questions:

    Yes, it's possible to listent for EVTS_CACHE_REBALANCE (not sure about PME-events.), though I can't see why would you like to do it.