You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/08/19 17:43:35 UTC

[GitHub] [accumulo] DomGarguilo opened a new pull request #2235: Correct chop behavior

DomGarguilo opened a new pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235


   Fixes #2222 
   
   There were two bugs in the chop behavior that these changes attempt to correct. The first being chops could be written after close is called. The second being new chops may be started after close returns.
   
   To account for these, a check is added to wait until the chop status becomes `NOT_ACTIVE` before close returns as well as a check to ensure close has not returned before a chop is written.


-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] keith-turner commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r704456954



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       The changes look good. Need to see if the new state affects existing code.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r717011448



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       I wasn't too sure how to best test to see if these changes affect existing code so I ended up running all the ITs on this branch. Everything looks good (except a failing ConcurrentDeleteTableIT which is known flaky and also fails on main so is probably unrelated. Might create a ticket for this.).
   
   I think these changes are ready for review @keith-turner 




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] milleruntime commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
milleruntime commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r722510497



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -739,11 +745,25 @@ private void checkifChopComplete(Set<StoredTabletFile> allFiles) {
     boolean completed;
 
     synchronized (this) {
+      if (closed) {
+        // if closed, do not attempt to transition to the MARKING state
+        return;
+      }
+      // when this returns true it means we transitioned to the MARKING state

Review comment:
       Sorry, nevermind this is calling the other method.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r720529129



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1447,11 +1470,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != ChopSelectionStatus.NOT_ACTIVE) {

Review comment:
       Oops, I had thought I included this change earlier. Just included in 2e3d97e




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] keith-turner commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r722386332



##########
File path: server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/CompactableImplFileManagerTest.java
##########
@@ -379,11 +379,15 @@ public void testChop() {
     tabletFiles = newFiles("C00004.rf", "C00006.rf", "F00003.rf", "F00004.rf");
     assertFalse(fileMgr.finishChop(tabletFiles));
     assertEquals(ChopSelectionStatus.SELECTED, fileMgr.getChopStatus());
-    assertFalse(fileMgr.finishMarkingChop());
+    try {
+      fileMgr.finishMarkingChop();
+    } catch (IllegalStateException e) {
+      // expected
+    }

Review comment:
       Could use the assertThrows functions from junit here




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] keith-turner commented on pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
keith-turner commented on pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#issuecomment-931737860


   @DomGarguilo in there is a method named `getCandidates()` that has the following bit of code in it.
   
   ```java
           case CHOP: {
             switch (chopStatus) {
               case NOT_ACTIVE:
               case SELECTING:
                 return Set.of();
   ```
   
   need to add the new enum to this switch like the following.
   
   ```java
           case CHOP: {
             switch (chopStatus) {
               case NOT_ACTIVE:
               case SELECTING:
               case MARKING:
                 return Set.of();
   ```
   
   This is the code that detemines which files are candidates for a chop compaction.  Unless chopStatus is SELECTED it should return the empty set.


-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] keith-turner commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r700595271



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       I think in the current code when a chop is actually marking the state will actually be NOT_ACTIVE.  Thinking we should introduce a new explicit state for MARKING and then we could do something like the following.
   
   ```suggestion
             || fileMgr.chopStatus == FileSelectionStatus.MARKING) {
   ```
   
   To go with the above change could do something like the following in checkIfChopComplete()
   
   ```java
     private void checkifChopComplete(Set<StoredTabletFile> allFiles) {
   
       boolean completed = false;
   
       synchronized (this) {
         if (closed) {
          // if closed do not attempt transition to marking state
           return;
        }
         // when this returns true it means we transitioned to the MARKING state
         completed = fileMgr.finishChop(allFiles);
       }
   
       if (completed) {
         try {
           markChopped();
         } finally {
           synchronized (this) {
             // this will transition from MARKING to NOT_ACTIVE
             fileMgr.finishMarkingChop();
             this.notifyAll();
           }
         }
   
         TabletLogger.selected(getExtent(), CompactionKind.CHOP, Set.of());
       }
     }
   ```
   
   In a [branch](https://github.com/keith-turner/accumulo/commits/accumulo-2199) I created for #2199 I have created a separate enum for chop status since chop only uses a subset of the file status states.  Adding an extra state that is only used for chop would make this separate enum even more useful.  For this PR could add the new state to the existing enum and I can fix it up later.
   




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r702084490



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       @keith-turner, I tried incorporating your suggestions in a9c0f9b. Not too sure if they are what you had in mind.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r722407974



##########
File path: server/tserver/src/test/java/org/apache/accumulo/tserver/tablet/CompactableImplFileManagerTest.java
##########
@@ -379,11 +379,15 @@ public void testChop() {
     tabletFiles = newFiles("C00004.rf", "C00006.rf", "F00003.rf", "F00004.rf");
     assertFalse(fileMgr.finishChop(tabletFiles));
     assertEquals(ChopSelectionStatus.SELECTED, fileMgr.getChopStatus());
-    assertFalse(fileMgr.finishMarkingChop());
+    try {
+      fileMgr.finishMarkingChop();
+    } catch (IllegalStateException e) {
+      // expected
+    }

Review comment:
       Good idea. Addressed in 76e6942




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] milleruntime commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
milleruntime commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r722509274



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -739,11 +745,25 @@ private void checkifChopComplete(Set<StoredTabletFile> allFiles) {
     boolean completed;
 
     synchronized (this) {
+      if (closed) {
+        // if closed, do not attempt to transition to the MARKING state
+        return;
+      }
+      // when this returns true it means we transitioned to the MARKING state

Review comment:
       This comment is outdated now.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] keith-turner commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r722312323



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -347,6 +347,15 @@ boolean finishChop(Set<StoredTabletFile> allFiles) {
       return completed;
     }
 
+    boolean finishMarkingChop() {
+      if (chopStatus == ChopSelectionStatus.MARKING) {
+        chopStatus = ChopSelectionStatus.NOT_ACTIVE;
+        return true;
+      } else {
+        return false;
+      }
+    }

Review comment:
       ```suggestion
       void finishMarkingChop() {
           Preconditions.checkState(chopStatus == ChopSelectionStatus.MARKING);
           chopStatus = ChopSelectionStatus.NOT_ACTIVE;
       }
   ```

##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -739,11 +749,25 @@ private void checkifChopComplete(Set<StoredTabletFile> allFiles) {
     boolean completed;
 
     synchronized (this) {
+      if (closed) {
+        // if closed, do not attempt to transition to the MARKING state
+        return;
+      }
+      // when this returns true it means we transitioned to the MARKING state
       completed = fileMgr.finishChop(allFiles);
     }
 
     if (completed) {
-      markChopped();
+      try {
+        markChopped();
+      } finally {
+        synchronized (this) {
+          // transition the state from MARKING to NOT_ACTIVE
+          fileMgr.finishMarkingChop();

Review comment:
       Could remove the boolean and change the method to have a precondition that expects the current chop state to be MARKING.  I made a suggested change for the method.  The way the code is currently written, it would be unexpected for the chop state to be anything else when this method is called.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo merged pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo merged pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235


   


-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r701172032



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       > > For this PR could add the new state to the existing enum and I can fix it up later.
   > 
   > Okay I'll go ahead and do that here
   
   @keith-turner, Actually do you think that the new state should just be added with the changes that will use it instead of adding it here before it is used anywhere? It seems like this PR could just be closed if there are plans to account for this later on.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r701029113



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       > For this PR could add the new state to the existing enum and I can fix it up later.
   
   Okay I'll go ahead and do that here




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] keith-turner commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r701178803



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       For the work on #2199 I would not be adding a new MARKING state, only a new enum specific to chop states.  Still need to make these changes. These changes could wait until the new enum is added and add the new state to that enum as that will be cleaner.  




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] DomGarguilo commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
DomGarguilo commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r717011448



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1388,11 +1388,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != FileSelectionStatus.NOT_ACTIVE) {

Review comment:
       I wasn't too sure how to best test to see if these changes affect existing code so I ended up running all the ITs on this branch. Everything looks good (except a failing ConcurrentDeleteTableIT which is known flaky and also fails on main so is probably unrelated. Might create a ticket for this.).
   
   I think these changes are ready for review @keith-turner 




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] keith-turner commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
keith-turner commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r719802372



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -1447,11 +1470,12 @@ public synchronized void close() {
 
       closed = true;
 
-      // wait while internal jobs are running or external compactions are committing, but do not
-      // wait on external compactions that are running
+      // wait while internal jobs are running, external compactions are committing or the status of
+      // chops is active, but do not wait on external compactions that are running
       while (runningJobs.stream()
           .anyMatch(job -> !((CompactionExecutorIdImpl) job.getExecutor()).isExternalId())
-          || !externalCompactionsCommitting.isEmpty()) {
+          || !externalCompactionsCommitting.isEmpty()
+          || fileMgr.chopStatus != ChopSelectionStatus.NOT_ACTIVE) {

Review comment:
       Need to make this check more narrow.  After closed is set to true above, its not possible to enter the marking state. So we only want to wait on things that were in the marking state before closed was set to true.
     
   ```suggestion
             || fileMgr.chopStatus == ChopSelectionStatus.MARKING) {
   ```




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] milleruntime commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
milleruntime commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r722152197



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -111,7 +111,7 @@
   private Set<CompactionServiceId> servicesUsed = new ConcurrentSkipListSet<>();
 
   enum ChopSelectionStatus {
-    SELECTING, SELECTED, NOT_ACTIVE
+    SELECTING, SELECTED, NOT_ACTIVE, MARKING

Review comment:
       It would be nice to have a description of the different states. Or if that isn't helpful, at least a description of the state to state transitions.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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



[GitHub] [accumulo] milleruntime commented on a change in pull request #2235: Correct chop behavior

Posted by GitBox <gi...@apache.org>.
milleruntime commented on a change in pull request #2235:
URL: https://github.com/apache/accumulo/pull/2235#discussion_r722135088



##########
File path: server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java
##########
@@ -739,11 +749,25 @@ private void checkifChopComplete(Set<StoredTabletFile> allFiles) {
     boolean completed;
 
     synchronized (this) {
+      if (closed) {
+        // if closed, do not attempt to transition to the MARKING state
+        return;
+      }
+      // when this returns true it means we transitioned to the MARKING state
       completed = fileMgr.finishChop(allFiles);
     }
 
     if (completed) {
-      markChopped();
+      try {
+        markChopped();
+      } finally {
+        synchronized (this) {
+          // transition the state from MARKING to NOT_ACTIVE
+          fileMgr.finishMarkingChop();

Review comment:
       Could you do something with the boolean that is returned from this method? It might not matter but since you are checking the state and returning an outcome, maybe a false should be handled.




-- 
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: notifications-unsubscribe@accumulo.apache.org

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