diff --git a/CHANGES.txt b/CHANGES.txt index 4dcefebb3bb..99c9c336384 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -438,6 +438,7 @@ Release 0.92.0 - Unreleased HBASE-4695 WAL logs get deleted before region server can fully flush (gaojinchao) HBASE-4708 Revert safemode related pieces of hbase-4510 (Harsh J) + HBASE-3515 [replication] ReplicationSource can miss a log after RS comes out of GC TESTS HBASE-4450 test for number of blocks read: to serve as baseline for expected diff --git a/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java b/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java index 85c3439660d..8c9cb9b6925 100644 --- a/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java +++ b/src/main/java/org/apache/hadoop/hbase/replication/ReplicationZookeeper.java @@ -432,14 +432,11 @@ public class ReplicationZookeeper { * @param filename name of the hlog's znode * @param peerId name of the cluster's znode */ - public void addLogToList(String filename, String peerId) { - try { - String znode = ZKUtil.joinZNode(this.rsServerNameZnode, peerId); - znode = ZKUtil.joinZNode(znode, filename); - ZKUtil.createWithParents(this.zookeeper, znode); - } catch (KeeperException e) { - this.abortable.abort("Failed add log to list", e); - } + public void addLogToList(String filename, String peerId) + throws KeeperException { + String znode = ZKUtil.joinZNode(this.rsServerNameZnode, peerId); + znode = ZKUtil.joinZNode(znode, filename); + ZKUtil.createWithParents(this.zookeeper, znode); } /** diff --git a/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java b/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java index c8bd2139010..152c5f667f9 100644 --- a/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java +++ b/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java @@ -210,7 +210,14 @@ public class ReplicationSourceManager { if (this.latestPath != null) { String name = this.latestPath.getName(); this.hlogsById.get(id).add(name); - this.zkHelper.addLogToList(name, src.getPeerClusterZnode()); + try { + this.zkHelper.addLogToList(name, src.getPeerClusterZnode()); + } catch (KeeperException ke) { + String message = "Cannot add log to zk for" + + " replication when creating a new source"; + stopper.stop(message); + throw new IOException(message, ke); + } src.enqueueLog(this.latestPath); } } @@ -247,7 +254,7 @@ public class ReplicationSourceManager { return this.sources; } - void logRolled(Path newLog) { + void logRolled(Path newLog) throws IOException { if (!this.replicating.get()) { LOG.warn("Replication stopped, won't add new log"); return; @@ -256,7 +263,11 @@ public class ReplicationSourceManager { synchronized (this.hlogsById) { String name = newLog.getName(); for (ReplicationSourceInterface source : this.sources) { - this.zkHelper.addLogToList(name, source.getPeerClusterZnode()); + try { + this.zkHelper.addLogToList(name, source.getPeerClusterZnode()); + } catch (KeeperException ke) { + throw new IOException("Cannot add log to zk for replication", ke); + } } for (SortedSet hlogs : this.hlogsById.values()) { if (this.sources.isEmpty()) {