HBASE-2849 HBase clients cannot recover when their ZooKeeper session becomes invalid

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@978802 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-07-24 05:18:38 +00:00
parent 01a251b50a
commit e258c33f78
2 changed files with 7 additions and 8 deletions

View File

@ -450,6 +450,8 @@ Release 0.21.0 - Unreleased
HBASE-2858 TestReplication.queueFailover fails half the time
HBASE-2863 HBASE-2553 removed an important edge case
HBASE-2866 Region permanently offlined
HBASE-2849 HBase clients cannot recover when their ZooKeeper session
becomes invalid (Benôit Sigoure via Stack)
IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable

View File

@ -211,13 +211,10 @@ public class HConnectionManager {
*
* @param event WatchedEvent witnessed by ZooKeeper.
*/
public void process(WatchedEvent event) {
KeeperState state = event.getState();
if(!state.equals(KeeperState.SyncConnected)) {
LOG.debug("Got ZooKeeper event, state: " + state + ", type: "
+ event.getType() + ", path: " + event.getPath());
}
if (state == KeeperState.Expired) {
public void process(final WatchedEvent event) {
final KeeperState state = event.getState();
if (!state.equals(KeeperState.SyncConnected)) {
LOG.warn("No longer connected to ZooKeeper, current state: " + state);
resetZooKeeper();
}
}
@ -228,7 +225,7 @@ public class HConnectionManager {
* @throws java.io.IOException if a remote or network exception occurs
*/
public synchronized ZooKeeperWrapper getZooKeeperWrapper() throws IOException {
if(zooKeeperWrapper == null) {
if (zooKeeperWrapper == null) {
zooKeeperWrapper =
ZooKeeperWrapper.createInstance(conf, HConnectionManager.class.getName());
zooKeeperWrapper.registerListener(this);