@FunctionalInterface public interface PartitionLostListener extends EventListener
When the cluster is initialized, each node becomes owner of some of the partitions and of a backup of some other partitions. We call the replica on the partition owner a "primary replica" and on the backup nodes "backup replicas". Partition replicas are ordered. A primary replica node keeps all data that is mapped to the partition. If a Hazelcast data structure is configured with 1 backup, its data is put into the primary replica and the first backup replica. Similarly, data of a Hazelcast data structure that is configured with 2 backups is put into the primary replica, the first backup replica and the second backup replica and so on.
When a node fails, primary replicas of its partitions are lost. In this case, ownership of each partition owned by the unreachable node is transferred to the first available backup node. After this point, other backup nodes sync themselves from the new partition owner node in order to populate the missing backup data. This sync only happens when backup partition replica versions are not equal to the primary ones.
In this context the partition loss detection algorithm works as follows:
PartitionLostEvent.getLostBackupCount()
denotes the replica
index up to which partition replicas are lost:
Partition
,
PartitionService
Modifier and Type | Method and Description |
---|---|
void |
partitionLost(PartitionLostEvent event)
Invoked when a primary replica of the partition is lost.
|
void partitionLost(PartitionLostEvent event)
event
- the event that contains the partition ID and the
backup count that has been lostCopyright © 2023 Hazelcast, Inc.. All rights reserved.