Skip to content

Commit

Permalink
lightning: fix SET SESSION on connection pool (pingcap#54927)
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored and hawkingrei committed Aug 1, 2024
1 parent cbd259c commit 52cea76
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lightning/pkg/importer/meta_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (m *dbTableMetaMgr) AllocTableRowIDs(ctx context.Context, rawRowIDMax int64
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,
Logger: m.tr.logger,
}
var newRowIDBase, newRowIDMax int64
Expand Down Expand Up @@ -391,7 +391,7 @@ func (m *dbTableMetaMgr) CheckAndUpdateLocalChecksum(ctx context.Context, checks
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,
Logger: m.tr.logger,
}
err = exec.Exec(ctx, "enable pessimistic transaction", "SET SESSION tidb_txn_mode = 'pessimistic';")
Expand Down Expand Up @@ -664,7 +664,7 @@ func (m *dbTaskMetaMgr) CheckTasksExclusively(ctx context.Context, action func(t
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,
Logger: log.FromContext(ctx),
}
err = exec.Exec(ctx, "enable pessimistic transaction", "SET SESSION tidb_txn_mode = 'pessimistic';")
Expand Down Expand Up @@ -735,7 +735,7 @@ func (m *dbTaskMetaMgr) CheckAndPausePdSchedulers(ctx context.Context) (pdutil.U
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,
Logger: log.FromContext(ctx),
}
err = exec.Exec(ctx, "enable pessimistic transaction", "SET SESSION tidb_txn_mode = 'pessimistic';")
Expand Down Expand Up @@ -875,7 +875,7 @@ func (m *dbTaskMetaMgr) CheckAndFinishRestore(ctx context.Context, finished bool
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,
Logger: log.FromContext(ctx),
}
err = exec.Exec(ctx, "enable pessimistic transaction", "SET SESSION tidb_txn_mode = 'pessimistic';")
Expand Down

0 comments on commit 52cea76

Please sign in to comment.