This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 82d28eff612 branch-4.0: [fix](temp-table) not clean temp table 
temporary until fix mem leak #59535 (#59551)
82d28eff612 is described below

commit 82d28eff6129fe56bc0e9826548000a532c48406
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Jan 7 18:19:16 2026 +0800

    branch-4.0: [fix](temp-table) not clean temp table temporary until fix mem 
leak #59535 (#59551)
    
    Cherry-picked from #59535
    
    Co-authored-by: morrySnow <[email protected]>
---
 .../main/java/org/apache/doris/catalog/Env.java    |  6 +-
 .../apache/doris/catalog/TemporaryTableMgr.java    | 73 ++++++++++------------
 2 files changed, 38 insertions(+), 41 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
index ee473b0c806..94ea44fd90d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
@@ -865,7 +865,8 @@ public class Env {
     }
 
     private void refreshSession(String sessionId) {
-        sessionReportTimeMap.put(sessionId, System.currentTimeMillis());
+        // TODO: do nothing now until we fix memory link on 
Env#sessionReportTimeMap and Env#aliveSessionSet
+        // sessionReportTimeMap.put(sessionId, System.currentTimeMillis());
     }
 
     public void checkAndRefreshSession(String sessionId) {
@@ -7359,7 +7360,8 @@ public class Env {
     }
 
     public void registerSessionInfo(String sessionId) {
-        this.aliveSessionSet.add(sessionId);
+        // TODO: do nothing now until we fix memory link on 
Env#sessionReportTimeMap and Env#aliveSessionSet
+        // this.aliveSessionSet.add(sessionId);
     }
 
     public void unregisterSessionInfo(String sessionId) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/TemporaryTableMgr.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/TemporaryTableMgr.java
index 1f9bf4c8b7c..a10ddb97351 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/TemporaryTableMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/TemporaryTableMgr.java
@@ -17,17 +17,11 @@
 
 package org.apache.doris.catalog;
 
-import org.apache.doris.common.Config;
 import org.apache.doris.common.util.MasterDaemon;
-import org.apache.doris.common.util.Util;
 
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 
-import java.util.Collection;
-import java.util.Date;
-import java.util.Map;
-
 /*
  * Delete temporary table when its creating session is gone
  */
@@ -41,38 +35,39 @@ public class TemporaryTableMgr extends MasterDaemon {
 
     @Override
     protected void runAfterCatalogReady() {
-        Map<String, Long> sessionReportTimeMap = 
Env.getCurrentEnv().getSessionReportTimeMap();
-        long currentTs = System.currentTimeMillis();
-        Collection<DatabaseIf<? extends TableIf>> internalDBs = 
Env.getCurrentEnv().getInternalCatalog().getAllDbs();
-        for (DatabaseIf<? extends TableIf> db : internalDBs) {
-            for (TableIf table : db.getTables()) {
-                if (!table.isTemporary()) {
-                    continue;
-                }
-
-                String sessionId = Util.getTempTableSessionId(table.getName());
-                boolean needDelete = false;
-                if (!sessionReportTimeMap.containsKey(sessionId)) {
-                    LOG.info("Cannot find session id for table " + 
table.getName());
-                    needDelete = true;
-                } else if (currentTs > sessionReportTimeMap.get(sessionId)
-                        + Config.loss_conn_fe_temp_table_keep_second * 1000) {
-                    LOG.info("Temporary table " + table.getName() + " is out 
of time: "
-                            + new Date(sessionReportTimeMap.get(sessionId)) + 
", current: " + new Date(currentTs));
-                    needDelete = true;
-                }
-
-                if (needDelete) {
-                    LOG.info("Drop temporary table " + table);
-                    try {
-                        Env.getCurrentEnv().getInternalCatalog()
-                            .dropTableWithoutCheck((Database) db, (Table) 
table, false, true);
-                    } catch (Exception e) {
-                        LOG.error("Drop temporary table error: db: {}, table: 
{}",
-                                db.getFullName(), table.getName(), e);
-                    }
-                }
-            }
-        }
+        // TODO: do nothing now until we fix memory link on 
Env#sessionReportTimeMap and Env#aliveSessionSet
+        // Map<String, Long> sessionReportTimeMap = 
Env.getCurrentEnv().getSessionReportTimeMap();
+        // long currentTs = System.currentTimeMillis();
+        // Collection<DatabaseIf<? extends TableIf>> internalDBs = 
Env.getCurrentEnv().getInternalCatalog().getAllDbs();
+        // for (DatabaseIf<? extends TableIf> db : internalDBs) {
+        //     for (TableIf table : db.getTables()) {
+        //         if (!table.isTemporary()) {
+        //             continue;
+        //         }
+        //
+        //         String sessionId = 
Util.getTempTableSessionId(table.getName());
+        //         boolean needDelete = false;
+        //         if (!sessionReportTimeMap.containsKey(sessionId)) {
+        //             LOG.info("Cannot find session id for table " + 
table.getName());
+        //             needDelete = true;
+        //         } else if (currentTs > sessionReportTimeMap.get(sessionId)
+        //                 + Config.loss_conn_fe_temp_table_keep_second * 
1000) {
+        //             LOG.info("Temporary table " + table.getName() + " is 
out of time: "
+        //                     + new Date(sessionReportTimeMap.get(sessionId)) 
+ ", current: " + new Date(currentTs));
+        //             needDelete = true;
+        //         }
+        //
+        //         if (needDelete) {
+        //             LOG.info("Drop temporary table " + table);
+        //             try {
+        //                 Env.getCurrentEnv().getInternalCatalog()
+        //                     .dropTableWithoutCheck((Database) db, (Table) 
table, false, true);
+        //             } catch (Exception e) {
+        //                 LOG.error("Drop temporary table error: db: {}, 
table: {}",
+        //                         db.getFullName(), table.getName(), e);
+        //             }
+        //         }
+        //     }
+        // }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to