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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new f8fb5f90b81 branch-2.1: [fix](Nereids) not release lock if schema 
changed when insert #47733 (#47833)
f8fb5f90b81 is described below

commit f8fb5f90b81e7975e2d54084a42ab414ee91e0ca
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Feb 12 19:52:41 2025 +0800

    branch-2.1: [fix](Nereids) not release lock if schema changed when insert 
#47733 (#47833)
    
    Cherry-picked from #47733
    
    Co-authored-by: morrySnow <zhangwen...@selectdb.com>
---
 .../nereids/trees/plans/commands/insert/InsertIntoTableCommand.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
index 2f36d26cd1b..9dadcafe862 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java
@@ -184,6 +184,7 @@ public class InsertIntoTableCommand extends Command 
implements ForwardWithSync,
                     LOG.warn("insert plan failed {} times. query id is {}. 
table id changed from {} to {}",
                             retryTimes, DebugUtil.printId(ctx.queryId()),
                             targetTableIf.getId(), 
newestTargetTableIf.getId());
+                    newestTargetTableIf.readUnlock();
                     continue;
                 }
                 // Use the schema saved during planning as the schema of the 
original target table.
@@ -191,6 +192,7 @@ public class InsertIntoTableCommand extends Command 
implements ForwardWithSync,
                     LOG.warn("insert plan failed {} times. query id is {}. 
table schema changed from {} to {}",
                             retryTimes, DebugUtil.printId(ctx.queryId()),
                             ctx.getStatementContext().getInsertTargetSchema(), 
newestTargetTableIf.getFullSchema());
+                    newestTargetTableIf.readUnlock();
                     continue;
                 }
                 if (ctx.getConnectType() == ConnectType.MYSQL && 
ctx.getMysqlChannel() != null) {


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

Reply via email to