You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/07/19 20:02:01 UTC

[GitHub] [hbase] bharathv commented on a change in pull request #3504: HBASE-26093 Replication is stuck due to zero length wal file in oldWALs directory

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



##########
File path: hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestBasicWALEntryStream.java
##########
@@ -716,4 +717,52 @@ public void testCleanClosedWALs() throws Exception {
       assertEquals(0, logQueue.getMetrics().getUncleanlyClosedWALs());
     }
   }
+
+  /**
+   * Tests that we handle EOFException properly if the wal has moved to oldWALs directory.
+   * @throws Exception exception
+   */
+  @Test
+  public void testEOFExceptionInOldWALsDirectory() throws Exception {
+    assertEquals(1, logQueue.getQueueSize(fakeWalGroupId));
+    AbstractFSWAL  abstractWAL = (AbstractFSWAL)log;

Review comment:
       nit: We don't need this down cast, do we?

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceWALReader.java
##########
@@ -166,6 +168,14 @@ public void run() {
       } catch (InterruptedException e) {
         LOG.trace("Interrupted while sleeping between WAL reads or adding WAL batch to ship queue");
         Thread.currentThread().interrupt();
+      } finally {
+        try {
+          if (entryStream != null) {
+            entryStream.close();
+          }
+        } catch (IOException ioe) {
+          LOG.warn("Exception while closing WALEntryStream", ioe);
+        }

Review comment:
       Can be simplified as follows,
   
   `IOUtils.closeQuietly(entryStream, e -> LOG.warn("Exception while closing WALEntryStream", e));`




-- 
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: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org