We're updating the issue view to help you get more done. 

The markedAsSeniorClusterMember event is not fired when a node becomes senior

Description

Steps to reproduce;

Register a ClusterEventListener in a plugin. Start the plugin on a junior node in a two node cluster.

Kill the senior node in the cluster.

Wait until the remaining node is promoted.

Expected results;

The ClusterEventListener.leftCluster(byte[]) and ClusterEventListener.markedAsSeniorMember() events are fired. 

Actual results:

Whilst the leftCluster(byte[]) event is fired, the markedAsSeniorMember() event is not.

Environment

None

Activity

Show:
Greg Thomas
February 8, 2018, 5:11 PM

Initial investigation, so I remember for later;

This happens because ClusterListener initialises seniorClusterMember on creation by calling CacheFactory.isSeniorClusterMember(). This returns true when the server first starts. Because ClusterListener already thinks it's senior, it never sends the markedAsSeniorMember() event when the other node leaves.

An easy fix (tested) is to simply set seniorClusterMember = false on creation; it will be set to true when the node starts a new cluster. 

But I'm more concerned that CacheFactory.isSeniorClusterMember() is returning true; At that point in time it shouldn't be as the node is never a senior member.

Fixed

Assignee

Greg Thomas

Reporter

Greg Thomas

Labels

None

Ignite Forum URL

None

Fix versions

Priority

Major
Configure