Details
-
New Feature
-
Status: In Review (View Workflow)
-
Critical
-
Resolution: Unresolved
Description
Large transactions can spend a long time rolling back after crash recovery.
During that time InnoDB keeps rollback state and record locks for work that is
only needed to make the old transaction effects disappear. This can delay
recovery completion and keep affected records locked longer than necessary.
This feature proposes an instant rollback mode for recovered InnoDB
transactions whose undo record count reaches a configurable threshold. When the
feature is enabled and a recovered transaction qualifies, InnoDB can release the
transaction record locks and let row access handle the remaining undo state
instead of running the full recovered transaction rollback immediately.
Proposed user-visible configuration:
- innodb_instant_rollback_enabled
Enables or disables instant rollback.
- innodb_instant_rollback_threshold
Minimum number of undo records required before instant rollback is considered.
The implementation tracks instant rollback state in trx_t and adds helper logic
for recovered and normal rollback paths. Row undo and lock handling are extended
to collect and release temporary instant-rollback record locks while preserving
the existing rollback flow for transactions that do not qualify.
The intended behavior is:
- Existing rollback behavior remains unchanged when the feature is disabled.
- Transactions below the configured threshold continue to use the normal rollback
path. - Dictionary transactions and other transactions that are not safe for instant
rollback continue to use the normal rollback path. - Crash recovery can expose recovered rows in their pre-transaction state without
waiting for the whole recovered transaction rollback to finish.
A new MTR test can cover the crash recovery case by enabling instant rollback,
creating an uncommitted transaction, restarting the server, and verifying that
the table contents are visible in the expected pre-transaction state.
Attachments
Issue Links
- relates to
-
MDEV-33853 Async rollback prepared transactions during binlog crash recovery
-
- Closed
-