Bug #115318 The description of undo tablespace is inaccurate
Submitted: 13 Jun 12:13 Modified: 13 Jun 12:24
Reporter: Xiaocong Ding (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: truncate, undo

[13 Jun 12:13] Xiaocong Ding
Description:
The document at https://dev.mysql.com/doc/refman/8.0/en/innodb-undo-tablespaces.html says:

"The initial size may differ when a new undo tablespace is created by a truncate operation. In this case, if the file extension size is larger than 16MB, and the previous file extension occurred within the last second, the new undo tablespace is created at a quarter of the size defined by the innodb_max_undo_log_size variable."

In the above document, "the size defined by the innodb_max_undo_log_size variable" should be replaced by "the old undo tablespace's size";

Refer to the following code in function trx_undo_truncate_tablespace:

```
  if (space != nullptr && space->m_undo_extend > UNDO_INITIAL_SIZE_IN_PAGES &&
      space->m_last_extended.elapsed() < 1000) {
    /* UNDO is being extended aggressively, don't reduce size to default. */
    n_pages = fil_space_get_size(old_space_id) / 4;
  }
``

How to repeat:
This is a documentation issue.

Suggested fix:
I think the following description is more reasonable:

"The initial size may differ when a new undo tablespace is created by a truncate operation. In this case, if the file extension size is larger than 16MB, and the previous file extension occurred within the last second, the new undo tablespace is created at a quarter of the old undo tablespace's size."
[13 Jun 12:24] MySQL Verification Team
Hi Mr. Fabio,

Thank you for your bug report.

Your description corresponds to the current behaviour.

This is now a verified Documentation bug.

Thanks.