Bug #24200 Provide backwards compatibility mode for 4.x "rollback on transaction timeout"
Submitted: 10 Nov 2006 20:01 Modified: 12 Jan 2007 21:29
Reporter: Hartmut Holzgraefe
Status: Closed
Category:Server: InnoDB Severity:S4 (Feature request)
Version:5.0 OS:
Assigned to: Paul DuBois Target Version:
Tags: backport_050030SP1, bfsm_2006_12_07
Triage: D5 (Feature request)

[10 Nov 2006 20:01] Hartmut Holzgraefe
Description:
Starting with MySQL 5.0.13 InnoDB will only roll back 
the last query on transaction timeouts. In 4.x and up
to 5.0.12 it would abort and roll back the complete
transaction on timeouts as it still does on transaction
deadlocks.

How to repeat:
testcase to be added ...

Suggested fix:
Add a ini setting "innodb_rollback_on_timeout"
to optionally restore the old behavior
[10 Nov 2006 20:04] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/15159

ChangeSet@1.2297, 2006-11-10 20:03:38+01:00, hartmut@mysql.com +5 -0
  Added innodb_rollback_on_timeout option to restore the 4.1 
  InnoDB timeout behavior (Bug #24200)
[13 Nov 2006 16:56] Heikki Tuuri
Osku,

can you add this also to the Innobase Oy official 5.0 source tree?

Regards,

Heikki
[19 Dec 2006 21:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17184

ChangeSet@1.2353, 2006-12-19 13:09:54-07:00, tsmith@siva.hindu.god +5 -0
  Added innodb_rollback_on_timeout option to restore the 4.1 
  InnoDB timeout behavior (Bug #24200)
[20 Dec 2006 0:58] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/17189

ChangeSet@1.2353, 2006-12-19 16:57:51-07:00, tsmith@siva.hindu.god +13 -0
  Added innodb_rollback_on_timeout option to restore the 4.1 
  InnoDB timeout behavior (Bug #24200)
[21 Dec 2006 14:56] Joerg Bruehe
Patch is included in 5.0.32 and will be in 5.1.15.
[11 Jan 2007 14:15] Osku Salerma
Added to Innobase 5.0/5.1 trees.
[12 Jan 2007 15:01] Heikki Tuuri
Hi!

This should be noted in the 5.0.32 changlelog (and 5.0.33 if it is there). It is still
missing from the 5.0 online manual.

Regards,

Heikki
[12 Jan 2007 21:29] Paul DuBois
Noted in 5.0.32, 5.0.33, 5.1.15 changelogs.

In MySQL 5.0.13 and up, InnoDB rolls back only the last statement on
a transaction timeout. A new option, --innodb_rollback_on_timeout,
causes InnoDB to abort and roll back the entire transaction if a
transaction timeout occurs (the same behavior as before MySQL
5.0.13).
[26 Feb 2007 10:17] dennismoore@dodgeit.com dennismoore@dodgeit.com
This shouldn't be an option, it should be the default.

The whole point of a transaction is that it is a group of statements that either all
succeed, or all fail. Making this behaviour "optional" makes no sense.
[16 May 2007 16:39] Harrison Fisk
>This shouldn't be an option, it should be the default.

>The whole point of a transaction is that it is a group of statements that either
>all succeed, or all fail. Making this behaviour "optional" makes no sense.

This behavior only applies with innodb_lock_wait_timeout and has no affect based on other
timeouts (such as wait_timeout, net_read_timeout, and so on).  

In the event of a row level lock timeout, it can be desirable to allow your application
to decide what to do (such as ROLLBACK, retry the statement, etc...) so this behavior was
added with an option for backwards compatibility if desired.