guangxuCheng commented on a change in pull request #3261:
URL: https://github.com/apache/hbase/pull/3261#discussion_r631686192



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java
##########
@@ -1953,6 +1954,24 @@ private void addToCompactingFiles(Collection<HStoreFile> 
filesToAdd) {
     Collections.sort(filesCompacting, 
storeEngine.getStoreFileManager().getStoreFileComparator());
   }
 
+  /**
+   * Remove the files from compacting files. This usually happens when we 
clear compaction queues.
+   */
+  void removeFromCompactingFiles(Collection<HStoreFile> filesToRemove) {
+    synchronized (filesCompacting) {
+      filesCompacting.removeAll(filesToRemove);
+      Collections.sort(filesCompacting, 
storeEngine.getStoreFileManager().getStoreFileComparator());
+    }

Review comment:
       Why need to sort here?

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java
##########
@@ -794,13 +795,30 @@ void shutdownLongCompactions(){
   }
 
   public void clearLongCompactionsQueue() {
+    removeFromFilesCompacting(longCompactions);

Review comment:
       If some requests fail to clean up the  compacting files, it may cause 
some of the compacting files to be removed, but the compacting request has not 
been remove from the queue

##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactSplit.java
##########
@@ -794,13 +795,30 @@ void shutdownLongCompactions(){
   }
 
   public void clearLongCompactionsQueue() {
+    removeFromFilesCompacting(longCompactions);
     longCompactions.getQueue().clear();
   }
 
   public void clearShortCompactionsQueue() {
+    removeFromFilesCompacting(shortCompactions);

Review comment:
       ditto




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


Reply via email to