-
Type:
Bug
-
Status: Closed
-
Resolution: Duplicate
-
Affects Version/s: 6.2.X EE, 7.0.0 Beta 4
-
Fix Version/s: 6.2.X EE, 7.0.0 Alpha 4
-
Component/s: Fault Tolerance, Fault Tolerance > Clustering Framework
-
Labels:None
-
Fix Priority:4
running these two scripts might demonstrate an inconsistency between the in memory "isMaster" and the lock table
import com.liferay.portal.kernel.cluster.ClusterExecutorUtil; import com.liferay.portal.service.LockLocalServiceUtil; import com.liferay.portal.kernel.cluster.Address; import com.liferay.portal.model.Lock; import com.liferay.portal.kernel.util.Validator; try { String _LOCK_CLASS_NAME = "com.liferay.portal.cluster.ClusterMasterExecutorImpl"; String localAddress = AddressSerializerUtil.serialize( ClusterExecutorUtil.getLocalClusterNodeAddress()); String masterAddress = null; for (int i = 0; i < 10; i++) { try { Lock lock = null; if (masterAddress == null) { lock = LockLocalServiceUtil.lock( _LOCK_CLASS_NAME, _LOCK_CLASS_NAME, localAddress); } else { lock = LockLocalServiceUtil.lock( _LOCK_CLASS_NAME, _LOCK_CLASS_NAME, masterAddress, localAddress); } masterAddress = lock.getOwner(); Address address = AddressSerializerUtil.deserialize(masterAddress); if (ClusterExecutorUtil.isClusterNodeAlive(address)) { out.println("master is alive"); break; } else { out.println("master is not alive"); } } catch (Exception e) { out.println("Master Address: " + masterAddress); out.println("Unable to acquire memory scheduler cluster lock" + e.getMessage()); } } out.println("Local Address:" + AddressSerializerUtil.deserialize(localAddress)); out.println("Master Address: " + AddressSerializerUtil.deserialize(masterAddress)); } catch (Exception e) { e.printStackTrace(); out.println(e.getMessage()); }
out.println(com.liferay.portal.kernel.cluster.ClusterMasterExecutorUtil.isMaster());
this can occur if the cluster temporarily loses connectivity during the master election process because a node only attempts to connect once before nominating itself as the master node.
- duplicates
-
LPS-59298 Two master nodes appear if master process hangs for a while
- Closed