Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightning: fix SET SESSION on connection pool (#54927) #55771

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
//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 @@
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,

Check warning on line 383 in br/pkg/lightning/restore/meta_manager.go

View check run for this annotation

Codecov / codecov/patch

br/pkg/lightning/restore/meta_manager.go#L383

Added line #L383 was not covered by tests
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 @@
//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 @@
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,

Check warning on line 711 in br/pkg/lightning/restore/meta_manager.go

View check run for this annotation

Codecov / codecov/patch

br/pkg/lightning/restore/meta_manager.go#L711

Added line #L711 was not covered by tests
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 @@
//nolint: errcheck
defer conn.Close()
exec := &common.SQLWithRetry{
DB: m.session,
DB: conn,

Check warning on line 847 in br/pkg/lightning/restore/meta_manager.go

View check run for this annotation

Codecov / codecov/patch

br/pkg/lightning/restore/meta_manager.go#L847

Added line #L847 was not covered by tests
Logger: log.FromContext(ctx),
}
err = exec.Exec(ctx, "enable pessimistic transaction", "SET SESSION tidb_txn_mode = 'pessimistic';")
Expand Down
Loading