Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
hello
i used to have all tables on ibdata1 before, then i switched to one file per table, but the ibdata1 file keep its size.
I recently switched to mariadb 10.1, and hoped that the defragmenting function would help to shrink the file, but it didn't worked.
I optimised all tables, but the ibdata1 file did not changed at all, it is still 197gb
MariaDB [(none)]> show status like '%defragment%';
|
+----------------------------------------+--------+
|
| Variable_name | Value |
|
+----------------------------------------+--------+
|
| Innodb_defragment_compression_failures | 0 |
|
| Innodb_defragment_failures | 32872 |
|
| Innodb_defragment_count | 113744 |
|
+----------------------------------------+--------+
|
3 rows in set (0.01 sec)
|
MariaDB [(none)]> show variables like '%defragment%';
|
+--------------------------------------+----------+
|
| Variable_name | Value |
|
+--------------------------------------+----------+
|
| innodb_defragment | ON |
|
| innodb_defragment_fill_factor | 0.900000 |
|
| innodb_defragment_fill_factor_n_recs | 20 |
|
| innodb_defragment_frequency | 40 |
|
| innodb_defragment_n_pages | 7 |
|
| innodb_defragment_stats_accuracy | 0 |
|
+--------------------------------------+----------+
|
Attachments
Issue Links
- blocks
-
MDEV-28699 Shrink temporary tablespaces without restart
-
- Closed
-
-
MDEV-32452 InnoDB system tablespace is not shrunk on slow shutdown
-
- Closed
-
- causes
-
MDEV-34216 Possible corruption when shrinking the system tablespace on innodb_fast_shutdown=0
-
- Closed
-
- is blocked by
-
MDEV-31373 innodb_undo_log_truncate=ON recovery results in a corrupted undo log
-
- Closed
-
- is duplicated by
-
MDEV-31462 ibdata1 shrinking
-
- Closed
-
- relates to
-
MDEV-19229 Allow innodb_undo_tablespaces to be changed after database creation
-
- Closed
-
-
MDEV-28699 Shrink temporary tablespaces without restart
-
- Closed
-
-
MDEV-29983 Deprecate innodb_file_per_table
-
- Closed
-
-
MDEV-29999 innodb_undo_log_truncate=ON is not crash safe
-
- Closed
-
-
MDEV-33112 innodb_undo_log_truncate=ON is blocking page writes
-
- Closed
-
-
MDEV-35398 Improve shrinking of system tablespace
-
- Closed
-
-
MDEV-35689 InnoDB system tables cannot be optimized or defragmented
-
- Stalled
-
-
MDEV-21952 ibdata1 file size growing in MariaDB
-
- Closed
-
-
MDEV-29986 Set innodb_undo_tablespaces=3 by default
-
- Closed
-
-
MDEV-32622 [mariadb-galera] The undo log is very large, how can there be fewer undo log logs
-
- Closed
-
-
MDEV-34529 Shrink the system tablespace when system tablespace contains MDEV-30671 leaked undo pages
-
- Closed
-
psumner, shrinking the system tablespace involves:
When using the default innodb_page_size=16k, there will be an allocation bitmap page every 16384*16384 bytes (256 megabytes, or quarter gigabyte). Shrinking a 300GiB file would involve traversing 1,200 bitmap pages. In an extreme case, the file could be shrunk to 256 megabytes or less, that is, we would write log covering just the first page of the file. In such an extreme case, the time should be dominated by the file system operation. Truncating or deleting a heavily fragmented file can take considerable time. How much, depends on the type of storage and the file system, and the operating system kernel version.
By popular demand, I filed
MDEV-32452so that this cleanup can be executed on shutdown rather than startup.