zenoyang commented on a change in pull request #6448:
URL: https://github.com/apache/incubator-doris/pull/6448#discussion_r696757229



##########
File path: fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
##########
@@ -1340,6 +1340,8 @@ private void startNonMasterDaemonThreads() {
         esRepository.start();
         // domain resolver
         domainResolver.start();
+        // start daemon thread to clean up old deleteInfos
+        deleteHandler.start();

Review comment:
       already fixed

##########
File path: fe/fe-core/src/main/java/org/apache/doris/common/Config.java
##########
@@ -153,6 +153,19 @@
      */
     @ConfField public static int label_clean_interval_second = 4 * 3600; // 4 
hours
 
+    /**
+     * Delete all deleteInfo older than *delete_info_keep_max_second*
+     * Setting a shorter time will reduce FE memory usage and image file size
+     * (Because all deleteInfo is stored in memory and image files before 
being deleted)
+     */
+    @ConfField(mutable = true)
+    public static int delete_info_keep_max_second = 3 * 24 * 3600; // 3 days
+
+    /**
+     * DeleteHandler will run every *delete_info_clean_interval_second* to 
clean old delete infos.
+     */
+    @ConfField public static int delete_info_clean_interval_second = 3600; // 
1 hours

Review comment:
       already fixed

##########
File path: fe/fe-core/src/main/java/org/apache/doris/load/DeleteHandler.java
##########
@@ -709,6 +746,48 @@ public void write(DataOutput out) throws IOException {
 
     public static DeleteHandler read(DataInput in) throws IOException {
         String json = Text.readString(in);
-        return GsonUtils.GSON.fromJson(json, DeleteHandler.class);
+        DeleteHandler deleteHandler = GsonUtils.GSON.fromJson(json, 
DeleteHandler.class);
+        deleteHandler.removeOldDeleteInfos();
+        return deleteHandler;
+    }
+
+    /**
+     * All FE timings or Master FE checkpoint trigger the deletion of old 
deleteInfos operations
+     */
+    public void removeOldDeleteInfos() {
+        if (Catalog.getCurrentCatalog().isReady()) {

Review comment:
       already fixed




-- 
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-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to