inno undo

Analyze undo tablespace files (.ibu or .ibd) for rollback segment and transaction history.

Usage

# Text summary
inno undo -f undo_001.ibu

# JSON output
inno undo -f undo_001.ibu --json

# Specific undo page
inno undo -f undo_001.ibu -p 3

# Verbose with undo records
inno undo -f undo_001.ibu -v

# Encrypted tablespace
inno undo -f undo_001.ibu --keyring /var/lib/mysql-keyring/keyring

Options

OptionDescription
-f, --filePath to InnoDB undo tablespace file (.ibu or .ibd)
-p, --pageShow a specific undo page only
-v, --verboseShow additional detail including undo records
--jsonOutput in JSON format
--page-sizeOverride page size (default: auto-detect)
--keyringPath to MySQL keyring file for encrypted tablespaces
--mmapUse memory-mapped I/O (faster for large files)

Output

Text Mode

Text output shows three sections:

  1. RSEG Array — rollback segment slots from the RSEG array header page, including which slots are active vs empty.

  2. Segment Summary — per-segment state (Active, Cached, ToPurge, ToFree, Prepared), transaction count, and undo log type.

  3. Transaction Listing — undo log headers with transaction IDs, transaction numbers, type (INSERT/UPDATE), and XID presence.

JSON Mode

Returns a structured UndoAnalysis object:

{
  "rseg_slots": [3, 4, 5],
  "rseg_headers": [...],
  "segments": [
    {
      "page_no": 3,
      "page_header": { "type_code": 2, "start": 150, "free": 256 },
      "segment_header": { "state": "Active", "last_log": 150 },
      "log_headers": [
        {
          "trx_id": 12345,
          "trx_no": 12344,
          "del_marks": false,
          "log_start": 176,
          "xid_exists": true,
          "dict_trans": false
        }
      ],
      "record_count": 8
    }
  ],
  "total_transactions": 42,
  "active_transactions": 3
}

Undo Segment States

StateDescription
ActiveCurrently in use by an active transaction
CachedAvailable for reuse, contains committed history
ToPurgeMarked for purge by the background purge thread
ToFreeMarked for segment deallocation
PreparedPart of an XA transaction in the PREPARED state

Background

MySQL 8.0+ supports dedicated undo tablespaces (.ibu files) that can be created, dropped, and truncated independently. Each undo tablespace contains a rollback segment (RSEG) array header page that points to up to 128 rollback segments, each of which manages up to 1024 undo log slots.

The inno undo subcommand reads the RSEG array, follows the slot pointers to rollback segment header pages, then walks undo segment pages to extract log headers and (with -v) individual undo records.