VladRodionov commented on a change in pull request #623: HBASE-22749: 
Distributed MOB compactions
URL: https://github.com/apache/hbase/pull/623#discussion_r338326011
 
 

 ##########
 File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/mob/DefaultMobStoreCompactor.java
 ##########
 @@ -326,31 +474,29 @@ protected boolean performCompaction(FileDetails fd, 
InternalScanner scanner, Cel
       progress.cancel();
       throw new InterruptedIOException(
           "Interrupted while control throughput of compacting " + 
compactionName);
+    } catch (IOException t) {
+      LOG.error("Mob compaction failed for region: " + 
store.getRegionInfo().getEncodedName());
+      throw t;
     } finally {
       // Clone last cell in the final because writer will append last cell 
when committing. If
       // don't clone here and once the scanner get closed, then the memory of 
last cell will be
       // released. (HBASE-22582)
       ((ShipperListener) writer).beforeShipped();
       throughputController.finish(compactionName);
       if (!finished && mobFileWriter != null) {
+        // Remove all MOB references because compaction failed
+        mobRefSet.get().clear();
+        // Abort writer
         abortWriter(mobFileWriter);
-      }
-      if (!finished && delFileWriter != null) {
-        abortWriter(delFileWriter);
-      }
-    }
-    if (delFileWriter != null) {
-      if (deleteMarkersCount > 0) {
-        // If the del file is not empty, commit it.
-        // If the commit fails, the compaction is re-performed again.
-        delFileWriter.appendMetadata(fd.maxSeqId, major, deleteMarkersCount);
-        delFileWriter.close();
-        mobStore.commitFile(delFileWriter.getPath(), path);
-      } else {
-        // If the del file is empty, delete it instead of committing.
-        abortWriter(delFileWriter);
+        //Check if other writers exist
+        if (mobWriters != null) {
+          for(StoreFileWriter w: mobWriters.getOutputWriters()) {
+            abortWriter(w);
+          }
+        }
       }
     }
+    // Commit or abort major mob writer
 
 Review comment:
   Nice catch. Fixed.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to