Apache9 commented on a change in pull request #3504:
URL: https://github.com/apache/hbase/pull/3504#discussion_r673963594



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
##########
@@ -274,11 +275,14 @@ private boolean handleEofException(Exception e, 
WALEntryBatch batch) {
     // since we don't add current log to recovered source queue so it is safe 
to remove.
     if ((e instanceof EOFException || e.getCause() instanceof EOFException) &&
       (source.isRecovered() || queue.size() > 1) && this.eofAutoRecovery) {
-      Path head = queue.peek();
+      Path path = queue.peek();
       try {
-        if (fs.getFileStatus(head).getLen() == 0) {
-          // head of the queue is an empty log file
-          LOG.warn("Forcing removal of 0 length log in queue: {}", head);
+        if (!fs.exists(path)) {
+          // There is a chance that wal has moved to oldWALs directory, so 
look there also.
+          path = AbstractFSWALProvider.getArchivedLogPath(path, conf);

Review comment:
       Oh, just saw this comment. Please see my new comment below, you need to 
keep getArchivedLogPath, as it is used when we want to archive a wal file.
   It is OK to remove the getArchivedLog in WALEntryStream.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to