MySQL 5.5 Reference Manual Including MySQL NDB Cluster 7.2 Reference Guide

14.9.7 Undo Logs

An undo log is a collection of undo log records associated with a single read-write transaction. An undo log record contains information about how to undo the latest change by a transaction to a clustered index record. If another transaction needs to see the original data as part of a consistent read operation, the unmodified data is retrieved from undo log records. Undo logs exist within undo log segments, which are contained within rollback segments. Rollback segments are physically part of the system tablespace.

InnoDB supports 128 rollback segments. The innodb_rollback_segments variable defines the number of rollback segments used by InnoDB.

Each rollback segment supports up to 1024 transactions, depending on the number of undo logs assigned to each transaction. (The 1024 value is the number of undo slots in a rollback segment.) A transaction is assigned up to two undo logs, one for each of the following operation types:

  1. INSERT operations

  2. UPDATE and DELETE operations

Undo logs are assigned as needed. For example, a transaction that performs INSERT, UPDATE, and DELETE operations is assigned two undo logs. A transaction that performs only INSERT operations is assigned a single undo log. Undo logs are assigned to a transaction from a single rollback segment that is also assigned to the transaction.

An undo log assigned to a transaction remains tied to the transaction for its duration. For example, an undo log assigned to a transaction for an INSERT operation is used for all INSERT operations performed by that transaction.

Given the factors described above, the following formulas can be used to estimate the number of concurrent read-write transactions that InnoDB is capable of supporting.


A transaction can encounter a concurrent transaction limit error before reaching the number of concurrent read-write transactions that InnoDB is capable of supporting. This occurs when the rollback segment assigned to a transaction runs out of undo slots. In such cases, try rerunning the transaction.