public interface PartitionLostListener extends EventListener
IMPORTANT: Please note that it may dispatch false-positive partition lost events when partial network split errors occur.
Partition loss detection algorithm works as follows: When the cluster is initialized, each node becomes owner of some of the partitions, and backup of the some other partitions. On a node failure, the first backup node becomes owner for a partition and all other backup nodes are shifted up in the partition backup order. Therefore, some nodes sync themselves from the new partition owner node since they are shifted up in the partition table and do not contain the backup data yet. Whey they issue a partition sync request, they set themselves in a custom state that indicates that a node is waiting for a partition sync for a particular backup. When the sync operation is completed, that sync flag is reset.
Lets say the owner of the partition crashes before it sends backup data to sync-waiting partitions. The first backup which will become the owner of the partition checks its replica-sync flags. If they are set, it detects that the owner failed before the backup node completes the sync process and issues a partition lost event.
Partition
,
PartitionService
Modifier and Type | Method and Description |
---|---|
void |
partitionLost(PartitionLostEvent event)
Invoked when a partition loses its owner and all backups.
|
void partitionLost(PartitionLostEvent event)
event
- the event that contains the partition ID and the backup count that has been lostCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.