You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/07/15 14:09:07 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #4095: show lost tabletIds which do not have any available replica

morningman commented on a change in pull request #4095:
URL: https://github.com/apache/incubator-doris/pull/4095#discussion_r455074399



##########
File path: fe/src/main/java/org/apache/doris/common/proc/IncompleteTabletsProcNode.java
##########
@@ -29,20 +29,24 @@
 
 public class IncompleteTabletsProcNode implements ProcNodeInterface {
     public static final ImmutableList<String> TITLE_NAMES = new ImmutableList.Builder<String>()
-            .add("UnhealthyTablets").add("InconsistentTablets").add("CloningTablets")
+            .add("UnhealthyTablets").add("InconsistentTablets").add("CloningTablets").add("LostTablets")
             .build();
+
     private static final Joiner JOINER = Joiner.on(",");
 
     Collection<Long> unhealthyTabletIds;
     Collection<Long> inconsistentTabletIds;
+    Collection<Long> noavlreplicaTabletIds;
     Collection<Long> cloningTabletIds;
 
     public IncompleteTabletsProcNode(Collection<Long> unhealthyTabletIds,
                                      Collection<Long> inconsistentTabletIds,
-                                     Collection<Long> cloningTabletIds) {
+                                     Collection<Long> cloningTabletIds,
+                                     Collection<Long> noavlreplicaTabletIds) {
         this.unhealthyTabletIds = unhealthyTabletIds;
         this.inconsistentTabletIds = inconsistentTabletIds;
         this.cloningTabletIds = cloningTabletIds;
+        this.noavlreplicaTabletIds = noavlreplicaTabletIds;

Review comment:
       ```suggestion
           this.noAvlreplicaTabletIds = noAvlreplicaTabletIds;
   ```

##########
File path: fe/src/main/java/org/apache/doris/common/proc/StatisticProcDir.java
##########
@@ -145,6 +150,12 @@ public ProcResult fetchResult() throws AnalysisException {
                                     unhealthyTabletIds.put(dbId, tablet.getId());
                                 }
 
+                                // find tablet with no available replica;
+                                if (!tablet.hasAvailableReplica(infoService, partition.getVisibleVersion(),

Review comment:
       I think we can just add a new enum value in `TabletStatus`, for example, `NO_AVAILABLE_REPLICA`, and return it by calling `getHealthStatusWithPriority()` above. So that we can save some iteration.
   
   But adding new enum value in `TabletStatus` may affect other code, which is uncontrollable. So I suggest to add a new parameter in `getHealthStatusWithPriority()`, eg, `getHealthStatusWithPriority(..., bool returnNoAvlExplicit)`.
   And if `returnNoAvlExplicit` is true, it return return `NO_AVAILABLE_REPLICA` explicit.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org