Skip to content

Commit

Permalink
[fix](Nereids) not release lock if schema changed when insert
Browse files Browse the repository at this point in the history
  • Loading branch information
morrySnow committed Feb 11, 2025
1 parent cbcebb1 commit 2bdc399
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,15 @@ public AbstractInsertExecutor initPlan(ConnectContext ctx, StmtExecutor stmtExec
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.
if (!ctx.getStatementContext().getInsertTargetSchema().equals(newestTargetTableIf.getFullSchema())) {
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 (!insertExecutor.isEmptyInsert()) {
Expand Down

0 comments on commit 2bdc399

Please sign in to comment.