Skip to content

Commit

Permalink
fix: xa commit/rollback should executed by master conn in read write …
Browse files Browse the repository at this point in the history
…splitting mode (#280)
  • Loading branch information
dk-lockdown committed Dec 17, 2022
1 parent 1d12859 commit 9962372
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/executor/read_write_splitting.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ func (executor *ReadWriteSplittingExecutor) ExecutorComQuery(
return nil, 0, err
}
return result, 0, err
case *ast.XACommitStmt, *ast.XARollbackStmt:
withSlaveCtx := proto.WithMaster(spanCtx)
return executor.dbGroup.Query(withSlaveCtx, newSql)
case *ast.InsertStmt, *ast.DeleteStmt, *ast.UpdateStmt:
txi, ok := executor.localTransactionMap.Load(connectionID)
if ok {
Expand Down

0 comments on commit 9962372

Please sign in to comment.