Skip to content

Commit a790427

Browse files
authored
Do not send rollback when there is no tx in server (#641)
1 parent 17cbda7 commit a790427

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/datashard/datashard.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,10 @@ func (sh *Conn) fire(q string) error {
303303
// TODO : unit tests
304304
func (sh *Conn) Cleanup(rule *config.FrontendRule) error {
305305
if rule.PoolRollback {
306-
if err := sh.fire("ROLLBACK"); err != nil {
307-
return err
306+
if sh.TxStatus() != txstatus.TXIDLE {
307+
if err := sh.fire("ROLLBACK"); err != nil {
308+
return err
309+
}
308310
}
309311
}
310312

0 commit comments

Comments
 (0)