yujun777 commented on code in PR #63884:
URL: https://github.com/apache/doris/pull/63884#discussion_r3339816345


##########
fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java:
##########
@@ -369,6 +371,46 @@ public void clearLastDBOfCatalog() {
         lastDBOfCatalog.clear();
     }
 
+    public void resetConnection() throws UserException {
+        closeTxnForConnectionReset();
+        if (!dbToTempTableNamesMap.isEmpty()) {
+            cleanupTemporaryTables(true);

Review Comment:
   Fixed in 9ba45f7f64f. `cleanupTemporaryTables()` now iterates over snapshots 
of the database/table-name sets before dropping temporary tables, so 
unregistering a dropped temporary table no longer mutates the active iterator. 
The same snapshot is used for both local master cleanup and forwarded cleanup.
   
   Added FE UT coverage for resetting a connection with multiple temporary 
tables where each drop removes the table from the session bookkeeping.
   
   Validation:
   - `tools/fast-compile-fe.sh ConnectContext.java`
   - `tools/fast-compile-fe.sh --test ConnectContextTest.java`
   - `run-fe-ut.sh --run ConnectContextTest`
   - `mvn -f fe/pom.xml -pl fe-core -am validate -DskipTests 
-Dmaven.build.cache.enabled=false`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to