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 2021/07/15 12:25:17 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #6200: [Performance] Optimize the performance of tabletReport

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



##########
File path: fe/fe-core/src/main/java/org/apache/doris/common/Config.java
##########
@@ -735,9 +735,17 @@
      */
     @ConfField(mutable = true, masterOnly = true)
     public static int max_backend_down_time_second = 3600; // 1h
+
+    /**
+     * If disable_storage_medium_check is true, ReportHandler would not check tablet's storage medium
+     * and disable storage cool down function, the default value is false.
+     * You can set the value true when you don't care what the storage medium of the tablet is.
+     */
+    @ConfField(mutable = true, masterOnly = true)
+    public static boolean disable_storage_medium_check = false;

Review comment:
       Better not changing the default value.
   And why not using origin config name?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/TabletInvertedIndex.java
##########
@@ -484,40 +512,40 @@ public void setNewSchemaHash(long partitionId, long indexId, int newSchemaHash)
         if (Catalog.isCheckpointThread()) {
             return;
         }
-        writeLock();
+        readLock();

Review comment:
       Why change to write lock?

##########
File path: fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
##########
@@ -17,6 +17,7 @@
 
 package org.apache.doris.master;
 
+import com.google.common.collect.Sets;

Review comment:
       import order

##########
File path: fe/fe-core/src/main/java/org/apache/doris/master/ReportHandler.java
##########
@@ -660,51 +679,64 @@ private static void deleteFromBackend(Map<Long, TTablet> backendTablets,
         int deleteFromBackendCounter = 0;
         int addToMetaCounter = 0;
         AgentBatchTask batchTask = new AgentBatchTask();
-        for (Long tabletId : backendTablets.keySet()) {
-            TTablet backendTablet = backendTablets.get(tabletId);
-            for (TTabletInfo backendTabletInfo : backendTablet.getTabletInfos()) {
-                boolean needDelete = false;
-                if (!foundTabletsWithValidSchema.contains(tabletId)) {
-                    if (isBackendReplicaHealthy(backendTabletInfo)) {
-                        // if this tablet is not in meta. try adding it.
-                        // if add failed. delete this tablet from backend.
-                        try {
-                            addReplica(tabletId, backendTabletInfo, backendId);
-                            // update counter
-                            needDelete = false;
-                            ++addToMetaCounter;
-                        } catch (MetaNotFoundException e) {
-                            LOG.warn("failed add to meta. tablet[{}], backend[{}]. {}",
-                                    tabletId, backendId, e.getMessage());
-                            needDelete = true;
-                        }
-                    } else {
-                        needDelete = true;
-                    }
-                }
-
-                if (needDelete) {
-                    // drop replica
-                    DropReplicaTask task = new DropReplicaTask(backendId, tabletId, backendTabletInfo.getSchemaHash());
-                    batchTask.addTask(task);
-                    LOG.warn("delete tablet[" + tabletId + " - " + backendTabletInfo.getSchemaHash()
-                            + "] from backend[" + backendId + "] because not found in meta");
-                    ++deleteFromBackendCounter;
-                }
-            } // end for tabletInfos
-
-            if (foundTabletsWithInvalidSchema.containsKey(tabletId)) {
-                // this tablet is found in meta but with invalid schema hash.
-                // delete it.
+        if (foundTabletsWithValidSchema.size() + foundTabletsWithInvalidSchema.size() == backendTablets.size()) {

Review comment:
       Add comment to explain this `if` condition




-- 
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: commits-unsubscribe@doris.apache.org

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