From f37215a32a2a6050333778082c9da4db8a27d9bd Mon Sep 17 00:00:00 2001 From: morrySnow <101034200+morrySnow@users.noreply.github.com> Date: Thu, 7 Dec 2023 20:15:12 +0800 Subject: [PATCH] [fix](Nereids) insert into target table lock should include finalize (#28085) --- .../nereids/trees/plans/commands/InsertIntoTableCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java index c17f215e75..213ec4df3c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/InsertIntoTableCommand.java @@ -155,12 +155,12 @@ public class InsertIntoTableCommand extends Command implements ForwardWithSync, physicalOlapTableSink.getDatabase(), physicalOlapTableSink.getTargetTable(), label, planner); insertExecutor.beginTransaction(); + insertExecutor.finalizeSink(sink, physicalOlapTableSink.isPartialUpdate(), + physicalOlapTableSink.isFromNativeInsertStmt()); } finally { targetTableIf.readUnlock(); } - insertExecutor.finalizeSink(sink, physicalOlapTableSink.isPartialUpdate(), - physicalOlapTableSink.isFromNativeInsertStmt()); executor.setProfileType(ProfileType.LOAD); // We exposed @StmtExecutor#cancel as a unified entry point for statement interruption // so we need to set this here