[MDEV-11383] AliSQL: [Feature] Issue#29: ADD INFORMATION_SCHEMA.INNODB_RSEG TABLE TO DISPLAY THE ROLLBACK INFORMATION Created: 2016-11-29  Updated: 2022-03-09  Resolved: 2022-03-09

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Marko Mäkelä
Resolution: Won't Do Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-11657 Cross-engine transaction metadata Open
relates to MDEV-22343 Remove SYS_TABLESPACES and SYS_DATAFILES Closed
relates to MDEV-25062 InnoDB read-write workload hits conte... Closed
Epic Link: AliSQL patches

 Description   

Description:
------------
This feature introduced one system table "information_schema.innodb_rseg" to
show the status of each of the rollback segments information.

https://github.com/alibaba/AliSQL/commit/0a4817fffcbfb0b1bad46122380d1cded6dfdce0



 Comments   
Comment by Marko Mäkelä [ 2017-11-17 ]

plinux, I would prefer not to add this table, because in a future version of MariaDB, I would like to redesign the InnoDB undo logs. There would no longer be rseg_id, but instead I would try to have an .ibu undo log file for each .ibd file.

In the patch, the column zip_size should always be reported as 0. If we want this table in MariaDB (expecting the columns to be changed in a later release), I think that this column should be omitted, and the table name should be something else, such as innodb_undo or innodb_transaction_logs.

Comment by Marko Mäkelä [ 2021-03-09 ]

As noted in MDEV-25062, we will have to change the format of undo logs to improve concurrency. My previous idea of having a separate undo log file for each tablespace would likely perform badly when a transaction is modifying multiple tables.

As part of undo log format changes, we may implement some instrumentation, which would have to reflect the format of our choice.

Comment by Marko Mäkelä [ 2022-03-09 ]

While we still have not changed the transaction metadata and undo log format beyond how it was changed in MDEV-12288 and MDEV-15132, I think that this view would be of very limited use. The columns are as follows:

show create table information_schema.innodb_rseg;
Table	Create Table
INNODB_RSEG	CREATE TEMPORARY TABLE `INNODB_RSEG` (
  `rseg_id` bigint(21) unsigned NOT NULL DEFAULT '0',
  `space_id` bigint(21) unsigned NOT NULL DEFAULT '0',
  `zip_size` bigint(21) unsigned NOT NULL DEFAULT '0',
  `page_no` bigint(21) unsigned NOT NULL DEFAULT '0',
  `max_size` bigint(21) unsigned NOT NULL DEFAULT '0',
  `curr_size` bigint(21) unsigned NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8

The rollback segment ID is conceptually a primary key. Ever since MDEV-19570 was implemented, there always are 128 rollback segments, limited by the current format of the DB_ROLL_PTR column.

The space_id identifies the undo tablespace. It and page_no are constant in the TRX_SYS page since the database creation.

The column zip_size should always be 0, because undo tablespaces can never use any ROW_FORMAT=COMPRESSED storage format.

Above, the most interesting columns would be curr_size and max_size. Ever since MDEV-22343 removed the dictionary table SYS_TABLESPACES, the size of each tablespace (including undo tablespaces) should be reported by INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES, by the columns FILE_SIZE and ALLOCATED_SIZE. That could be used for monitoring how well innodb_undo_log_truncate=ON is performing.

Generated at Thu Feb 08 07:49:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.