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


##########
server/base/src/main/java/org/apache/accumulo/server/manager/state/TabletGoalState.java:
##########
@@ -84,6 +85,15 @@ public static TabletGoalState compute(TabletMetadata tm, 
TabletState currentStat
         return TabletGoalState.UNASSIGNED;
       }
 
+      // When the tablet has wals and it will not be hosted normally, then 
cause it to
+      // be hosted so that recovery can occur. When tablet availability is 
ONDEMAND or
+      // UNHOSTED, then this tablet will eventually become unhosted after 
recovery occurs.
+      // This could cause a little bit of churn on the cluster w/r/t 
balancing, but it's
+      // necessary.
+      if (!tm.getLogs().isEmpty() && tm.getTabletAvailability() != 
TabletAvailability.HOSTED) {

Review Comment:
   The preempts the next few lines that set the goal for an offline table to 
UNASSIGNED.  So this would host tablets for an offline table.  Was that 
intentional?  This seems similar to hosting tablets where tablet is 
availability is UNHOSTED.
   
   For tablets with wals that are offline or have a tablet availability of 
unhosted could leave them alone and just log a warning, only hosting ondemand 
tablets w/ wals.  Not sure though, I can think of cases where its good to host 
and others where its good not to host.  One reason not to host is because it 
follows the users guidance, they may have had a good reason for not wanting 
tablets hosted.  That would look something like the following.
   
   ```java
         if (!params.isTableOnline(tm.getTableId())) {
           return UNASSIGNED;
         }
         if (!tm.getLogs().isEmpty() && tm.getTabletAvailability() == 
TabletAvailability.ONDEMAND) {
           return TabletGoalState.HOSTED;
         }
        
   ```
   
   Then maybe the NEEDS_RECOVERY could cause the warning to log in the manager.



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