You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2013/04/24 07:34:28 UTC
svn commit: r1471256 -
/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Author: stack
Date: Wed Apr 24 05:34:28 2013
New Revision: 1471256
URL: http://svn.apache.org/r1471256
Log:
HBASE-7122 Proper warning message when opening a log file with no entries (idle cluster)
Modified:
hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
Modified: hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java?rev=1471256&r1=1471255&r2=1471256&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java (original)
+++ hbase/branches/0.95/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java Wed Apr 24 05:34:28 2013
@@ -620,6 +620,7 @@ public class ReplicationSource extends T
}
}
} catch (IOException ioe) {
+ if (ioe instanceof EOFException && isCurrentLogEmpty()) return true;
LOG.warn(peerClusterZnode + " Got: ", ioe);
this.reader = null;
if (ioe.getCause() instanceof NullPointerException) {
@@ -637,6 +638,16 @@ public class ReplicationSource extends T
return true;
}
+ /*
+ * Checks whether the current log file is empty, and it is not a recovered queue. This is to
+ * handle scenario when in an idle cluster, there is no entry in the current log and we keep on
+ * trying to read the log file and get EOFEception. In case of a recovered queue the last log file
+ * may be empty, and we don't want to retry that.
+ */
+ private boolean isCurrentLogEmpty() {
+ return (this.repLogReader.getPosition() == 0 && !queueRecovered && queue.size() == 0);
+ }
+
/**
* Do the sleeping logic
* @param msg Why we sleep