[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272375#comment-13272375
 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-253:
------------------------------------------------

Here I am thinking about 2 scenarios may create this problem:
a)
1) ZKFC1 and ActiveNN is running in one machine.
2) ZKFC2 and StandbyNN is running in another machine.
3) Now ZKFC1 got killed. So, now ZKFC2 may get notification to switch to active 
and fence the previous active node. As part of fencing, it may kill -9 the 
current active NN and after that it may switch the current standByNN to active. 
But previous NN (bkjm) might not clean the lock immediately because it will 
wait till session timeout(3000).
4) So, the switch may fail as othen NN lock not release yet.

 We may have stop the BKJM grecefully(BKJM should ensure his lock cleaned on 
stop instead of waiting for session timeout) instead of kill -9 as part of 
Fencing?

b) 
1) ZKFC1 and ActiveNN is running in one machine.
2) ZKFC2 and StandbyNN is running in another machine.
3) Stop the current NN gracefully, Here BKJM will just close his zkclient, but 
lock may not be released immediately?.(wait for session timeout 3000)
4) Now ZKFC1 will detect the ActiveNode state and found that it is down and it 
will quit the leader election.
   ZKFC2 may try to switch other node imediately because of other node deletion 
notification (before 3000ms itself).
5) So, the switch may fail again here, because other node might not released 
the lock yet.

Yes, Having the same locking mechanism as ZKFC and giving the same path can 
solve the problems I feel.

{quote}
1.zkclient session timeout is hard coded and I feel, should be configurable.
ZooKeeper(zkConnect, 3000, new ZkConnectionWatcher()); //3000 as default.
{quote}
Good to make it configurable.


                
> BKJM:Switch from standby to active fails and NN gets shut down due to delay 
> in clearing of lock
> -----------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-253
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-253
>             Project: Bookkeeper
>          Issue Type: Bug
>          Components: bookkeeper-client
>            Reporter: suja s
>            Assignee: Uma Maheswara Rao G
>
> Normal switch fails. 
> (BKjournalManager zk session timeout is 3000 and ZKFC session timeout is 
> 5000. By the time control comes to acquire lock the previous lock is not 
> released which leads to failure in lock acquisition by NN and NN gets 
> shutdown. Ideally it should have been done)
> =============================================================================
> 2012-05-09 20:15:29,732 ERROR org.apache.hadoop.contrib.bkjournal.WriteLock: 
> Failed to acquire lock with /ledgers/lock/lock-0000000007, lock-0000000006 
> already has it
> 2012-05-09 20:15:29,732 FATAL 
> org.apache.hadoop.hdfs.server.namenode.FSEditLog: Error: 
> recoverUnfinalizedSegments failed for required journal 
> (JournalAndStream(mgr=org.apache.hadoop.contrib.bkjournal.BookKeeperJournalManager@412beeec,
>  stream=null))
> java.io.IOException: Could not acquire lock
> at org.apache.hadoop.contrib.bkjournal.WriteLock.acquire(WriteLock.java:107)
> at 
> org.apache.hadoop.contrib.bkjournal.BookKeeperJournalManager.recoverUnfinalizedSegments(BookKeeperJournalManager.java:406)
> at 
> org.apache.hadoop.hdfs.server.namenode.JournalSet$6.apply(JournalSet.java:551)
> at 
> org.apache.hadoop.hdfs.server.namenode.JournalSet.mapJournalsAndReportErrors(JournalSet.java:322)
> at 
> org.apache.hadoop.hdfs.server.namenode.JournalSet.recoverUnfinalizedSegments(JournalSet.java:548)
> at 
> org.apache.hadoop.hdfs.server.namenode.FSEditLog.recoverUnclosedStreams(FSEditLog.java:1134)
> at 
> org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startActiveServices(FSNamesystem.java:598)
> at 
> org.apache.hadoop.hdfs.server.namenode.NameNode$NameNodeHAContext.startActiveServices(NameNode.java:1287)
> at 
> org.apache.hadoop.hdfs.server.namenode.ha.ActiveState.enterState(ActiveState.java:61)
> at 
> org.apache.hadoop.hdfs.server.namenode.ha.HAState.setStateInternal(HAState.java:63)
> at 
> org.apache.hadoop.hdfs.server.namenode.ha.StandbyState.setState(StandbyState.java:49)
> at 
> org.apache.hadoop.hdfs.server.namenode.NameNode.transitionToActive(NameNode.java:1219)
> at 
> org.apache.hadoop.hdfs.server.namenode.NameNodeRpcServer.transitionToActive(NameNodeRpcServer.java:978)
> at 
> org.apache.hadoop.ha.protocolPB.HAServiceProtocolServerSideTranslatorPB.transitionToActive(HAServiceProtocolServerSideTranslatorPB.java:107)
> at 
> org.apache.hadoop.ha.proto.HAServiceProtocolProtos$HAServiceProtocolService$2.callBlockingMethod(HAServiceProtocolProtos.java:3633)
> at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:427)
> at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:916)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1692)
> at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1688)
> at java.security.AccessController.doPrivileged(Native Method)
> at javax.security.auth.Subject.doAs(Subject.java:396)
> at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1232)
> at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1686)
> 2012-05-09 20:15:29,736 INFO org.apache.hadoop.hdfs.server.namenode.NameNode: 
> SHUTDOWN_MSG: 
> /************************************************************
> SHUTDOWN_MSG: Shutting down NameNode at HOST-XX-XX-XX-XX/XX.XX.XX.XX
> Scenario:
> Start ZKFCS, NNs
> NN1 is active and NN2 is standby
> Stop NN1. NN2 tries to transition to active and gets shut down

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to