You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zddr (via GitHub)" <gi...@apache.org> on 2023/12/26 10:16:22 UTC

[PR] [enhance](mtmv)iot manager [doris]

zddr opened a new pull request, #29075:
URL: https://github.com/apache/doris/pull/29075

   ## Proposed changes
   
   Issue Number: close #xxx
   
   <!--Describe your changes.-->
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #29075:
URL: https://github.com/apache/doris/pull/29075#discussion_r1438777673


##########
fe/fe-core/src/main/java/org/apache/doris/insertoverwrite/InsertOverwriteManager.java:
##########
@@ -0,0 +1,194 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.insertoverwrite;
+
+import org.apache.doris.catalog.Env;
+import org.apache.doris.catalog.OlapTable;
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.io.Text;
+import org.apache.doris.common.io.Writable;
+import org.apache.doris.common.util.MasterDaemon;
+import org.apache.doris.insertoverwrite.InsertOverwriteLog.InsertOverwriteOpType;
+import org.apache.doris.persist.gson.GsonUtils;
+
+import com.google.common.collect.Maps;
+import com.google.gson.annotations.SerializedName;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+public class InsertOverwriteManager extends MasterDaemon implements Writable {
+    private static final Logger LOG = LogManager.getLogger(InsertOverwriteManager.class);
+
+    private static final long CLEAN_INTERVAL_SECOND = 10;
+
+    @SerializedName(value = "tasks")
+    private Map<Long, InsertOverwriteTask> tasks = Maps.newConcurrentMap();
+
+    public InsertOverwriteManager() {
+        super("InsertOverwriteDropDirtyPartitions", CLEAN_INTERVAL_SECOND * 1000);
+    }
+
+    /**
+     * register insert overwrite task
+     *
+     * @param dbId
+     * @param tableId
+     * @param tempPartitionNames
+     * @return taskId
+     */
+    public long registerTask(long dbId, long tableId, List<String> tempPartitionNames) {
+        long taskId = Env.getCurrentEnv().getNextId();
+        InsertOverwriteTask task = new InsertOverwriteTask(dbId, tableId,
+                tempPartitionNames);
+        tasks.put(taskId, task);
+        Env.getCurrentEnv().getEditLog()
+                .logInsertOverwrite(new InsertOverwriteLog(taskId, task, InsertOverwriteOpType.ADD));
+        return taskId;
+    }
+
+    /**
+     * when insert overwrite fail, try drop temp partition
+     *
+     * @param taskId
+     */
+    public void taskFail(long taskId) {
+        boolean rollback = rollback(taskId);
+        if (rollback) {
+            removeTask(taskId);
+        } else {
+            cancelTask(taskId);
+        }
+    }
+
+    /**
+     * when insert overwrite success, drop task
+     *
+     * @param taskId
+     */
+    public void taskSuccess(long taskId) {
+        removeTask(taskId);
+    }
+
+    /**
+     * for transterToMaster,try drop all temp partitions
+     */
+    public void allTaskFail() {
+        LOG.info("try drop all temp partitions when transterToMaster");

Review Comment:
   ```suggestion
           LOG.info("try drop all temp partitions when transferToMaster");
   ```



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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1872907695

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 47.65 seconds
    stream load tsv:          577 seconds loaded 74807831229 Bytes, about 123 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          28.4 seconds inserted 10000000 Rows, about 352K ops/s
    storage size: 17183804588 Bytes


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1870224065

   run buildall


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1872906573

   
   TPC-H test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
   ```
   Tpch sf100 test result on commit 6a2d56808478c6663ad71331166b51d02a81d198, data reload: false
   
   run tpch-sf100 query with default conf and session variables
   q1	5464	5097	5152	5097
   q2	391	164	158	158
   q3	1465	1162	1151	1151
   q4	1096	760	741	741
   q5	3130	3116	3102	3102
   q6	229	141	134	134
   q7	995	515	579	515
   q8	2182	2289	2238	2238
   q9	6712	6683	6673	6673
   q10	3198	3115	3152	3115
   q11	333	229	219	219
   q12	391	233	235	233
   q13	4365	3732	3657	3657
   q14	249	229	212	212
   q15	604	562	544	544
   q16	450	390	430	390
   q17	1047	497	515	497
   q18	7111	6759	6751	6751
   q19	1641	1547	1632	1547
   q20	627	357	356	356
   q21	2849	2419	2449	2419
   q22	403	335	349	335
   Total cold run time: 44932 ms
   Total hot run time: 40084 ms
   
   run tpch-sf100 query with default conf and set session variable runtime_filter_mode=off
   q1	5117	5137	5108	5108
   q2	342	270	246	246
   q3	3373	3317	3287	3287
   q4	2129	2000	2004	2000
   q5	5961	5931	5951	5931
   q6	225	122	124	122
   q7	2377	1912	1903	1903
   q8	3547	3669	3680	3669
   q9	9075	8945	8973	8945
   q10	3883	3910	3938	3910
   q11	598	484	498	484
   q12	818	688	653	653
   q13	3872	3198	3236	3198
   q14	314	268	258	258
   q15	600	555	562	555
   q16	542	515	528	515
   q17	2030	1848	1804	1804
   q18	8829	8464	8371	8371
   q19	1765	1666	1703	1666
   q20	2307	2002	1998	1998
   q21	5695	5415	5400	5400
   q22	579	542	487	487
   Total cold run time: 63978 ms
   Total hot run time: 60510 ms
   ```
   


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1872904142

   PR approved by anyone and no changes requested.


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #29075:
URL: https://github.com/apache/doris/pull/29075


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "doris-robot (via GitHub)" <gi...@apache.org>.
doris-robot commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1870266345

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 48.45 seconds
    stream load tsv:          566 seconds loaded 74807831229 Bytes, about 126 MB/s
    stream load json:         19 seconds loaded 2358488459 Bytes, about 118 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          28.0 seconds inserted 10000000 Rows, about 357K ops/s
    storage size: 17183931086 Bytes


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1870242165

   run buildall


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1872880526

   run buildall


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


Re: [PR] [fix](mtmv)fix insert overwrite will generate garbage temporary partition when restarting FE [doris]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #29075:
URL: https://github.com/apache/doris/pull/29075#issuecomment-1872904135

   PR approved by at least one committer and no changes requested.


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