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/06/03 08:34:20 UTC

[GitHub] [hbase] virajjasani commented on a change in pull request #3277: HBASE-25893 Corruption in recovered WAL in WALSplitter

virajjasani commented on a change in pull request #3277:
URL: https://github.com/apache/hbase/pull/3277#discussion_r644575803



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java
##########
@@ -1369,13 +1369,17 @@ public LogRecoveredEditsOutputSink(PipelineController controller, EntryBuffers e
      */
     @Override
     public List<Path> finishWritingAndClose() throws IOException {
-      boolean isSuccessful = false;
-      List<Path> result = null;
+      boolean isSuccessful;
+      List<Path> result;
+      List<IOException> thrown;
       try {
         isSuccessful = finishWriting(false);
       } finally {
-        result = close();
-        List<IOException> thrown = closeLogWriters(null);
+        try {
+          thrown = closeLogWriters(null);
+        } finally {
+          result = close();
+        }
         if (thrown != null && !thrown.isEmpty()) {

Review comment:
       With this change, `thrown` will never be `null` so we can restrict this to
   ```
   if (!thrown.isEmpty())
   ```

##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java
##########
@@ -1565,49 +1569,23 @@ Path closeWriter(String encodedRegionName, WriterAndPath wap, List<IOException>
 
 
     private List<IOException> closeLogWriters(List<IOException> thrown) throws IOException {
-      if (writersClosed) {
-        return thrown;
-      }
-
       if (thrown == null) {
         thrown = Lists.newArrayList();
       }
-      try {
-        for (WriterThread t : writerThreads) {
-          while (t.isAlive()) {
-            t.shouldStop = true;
-            t.interrupt();
-            try {
-              t.join(10);
-            } catch (InterruptedException e) {
-              IOException iie = new InterruptedIOException();
-              iie.initCause(e);
-              throw iie;
-            }
-          }
-        }
-      } finally {
-        WriterAndPath wap = null;
-        for (SinkWriter tmpWAP : writers.values()) {
+
+      for (WriterThread t : writerThreads) {
+        while (t.isAlive()) {
+          t.shouldStop = true;
+          t.interrupt();
           try {
-            wap = (WriterAndPath) tmpWAP;
-            wap.w.close();

Review comment:
       That's correct. @saintstack @ramkrish86 any thoughts about this?




-- 
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.

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