igniterealtime/openfire-hazelcast-plugin

Incorrect cluster state reported in secondary nodes of cluster

devillaccc opened this issue · 2 comments

Steup: Two nodes in cluster, Openfire 4.2.0, plugins: custom plugin 'aplugin', hazelcast, other standard OF

  1. Start Openfire in one node
  2. A plugin named 'aplugin' determines cluster status while its initializing using - ClusterManager.isClusteringAvailable() && ClusterManager.isSeniorClusterMember() - Which returns true
  3. After Primary node initialized completely - Openfire service on Secondary node started
  4. During 'aplugin' initialization as in Step#2 in secondary node, the condition returns true. Expecting the condition to evaluate to false.

Given other logging on the server, is the cluster status "settled" at the point that the plugin makes this determination?

By which I mean, is the Hazelcast plugin also initialising at the same point, and so it's too early to know if this cluster node will or will not be the senior member?

As an aside, have you tested this with a modern version of Openfire? There's been a not insignificant amount of work in the intervening years as regards clustering.

You're using the wrong API. You need ClusterManager.isSeniorClusterMemberOrNotClustered() which has been available for over 2 years since Openfire 4.3.0.