keith-turner commented on code in PR #3903:
URL: https://github.com/apache/accumulo/pull/3903#discussion_r1376598233


##########
server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java:
##########
@@ -396,7 +397,14 @@ private TableMgmtStats 
manageTablets(Iterator<TabletManagement> iter,
       }
 
       if (tm.getOperationId() != null) {
-        goal = TabletGoalState.UNASSIGNED;
+        // If there are still wals the tablet needs to be hosted
+        // to process the wals before starting the merge op
+        if (tm.getLogs().isEmpty()
+            && tm.getOperationId().getType() == TabletOperationType.MERGING) {
+          goal = TabletGoalState.UNASSIGNED;
+        } else {
+          goal = TabletGoalState.HOSTED;
+        }

Review Comment:
   When a tablet has an operationid, generally want it unassigned.  So need to 
work in an exception of that in the case of walogs and merge
   
   ```suggestion
           if (!tm.getLogs().isEmpty()
               && tm.getOperationId().getType() == TabletOperationType.MERGING) 
{
             goal = TabletGoalState.HOSTED;
           } else {
             goal = TabletGoalState.UNASSIGNED;
           }
   ```



##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletManagementIterator.java:
##########
@@ -279,6 +280,12 @@ private boolean shouldReturnDueToLocation(final 
TabletMetadata tm,
             || (tm.getHostingGoal() == TabletHostingGoal.ONDEMAND && 
tm.getHostingRequested()))) {
           return true;
         }
+        // If the Tablet has walogs and operation id then need to return so
+        // TGW can bring online to process the logs
+        if (tm.getLogs().isEmpty() && tm.getOperationId() != null

Review Comment:
   ```suggestion
           if (!tm.getLogs().isEmpty() && tm.getOperationId() != null
   ```



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to