Skip to content

Commit

Permalink
lightning: fix SET SESSION on connection pool (#54927) (#55771)
Browse files Browse the repository at this point in the history
close #49826
  • Loading branch information
ti-chi-bot authored Aug 30, 2024
1 parent 9714f46 commit 7759463
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions br/pkg/lightning/restore/meta_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,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 @@ -380,7 +380,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 @@ -649,7 +649,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 @@ -708,7 +708,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 @@ -844,7 +844,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 7759463

Please sign in to comment.