Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
2.0.0-alpha, 3.0.0-alpha1
-
None
-
None
Description
When a Standby NN becomes Active, it will first create his sequential lock entry create lock-000X in ZK and then tries to acquire the lock as shown below:
myznode = zkc.create(lockpath + "/lock-", new byte[]
Unknown macro: {'0'},
Ids.OPEN_ACL_UNSAFE,
CreateMode.EPHEMERAL_SEQUENTIAL);
if ((lockpath + "/" + nodes.get(0)).equals(myznode)) {
if (LOG.isTraceEnabled())Unknown macro: { LOG.trace("Lock acquired - " + myznode); }lockCount.set(1);
zkc.exists(myznode, this);
return;
} elseUnknown macro: { LOG.error("Failed to acquire lock with " + myznode + ", " + nodes.get(0) + " already has it"); throw new IOException("Could not acquire lock"); }
Say the transition to standby fails to acquire the lock it will throw the exception and NN is getting shutdown. Here the problem is, the lock entry lock-000X will exists in the ZK till session expiry and the further start-up will not be able to acquire lock.