[MDEV-26688] Can no longer modify aria_block_size Created: 2021-09-26  Updated: 2023-03-03

Status: Confirmed
Project: MariaDB Server
Component/s: Storage Engine - Aria
Affects Version/s: 10.6.4, 10.6, 10.7, 10.8
Fix Version/s: 10.6

Type: Bug Priority: Major
Reporter: Damon Mueller Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: None
Environment:

CentOS 7 and Rocky Linux 8


Issue Links:
Duplicate
is duplicated by MDEV-28311 aria_block_size minimum size 8192 Open
Relates
relates to MDEV-19805 Changing aria block size to 1024 will... Closed

 Description   

I've been using aria_block_size 1024 for performance reasons I noticed in testing my application long ago.

Importing my database into a fresh mysql install using the default value 8192 results in poor performance by comparison. Certain transactions take > 2-4X or longer, very noticeable.

I'd like to test 4096 but I think I'm encountering a bug.

The mariadb tables we changed to Aria from MyISAM (I think in 10.4, maybe more recently). In doing this I think you've locked the ability to change that setting.

Starting from a fresh install, without starting the server. I edit my.cnf, change aria_block_size to 4096. But on first start up get an error because the mysql (system) database has Aria tables using a different block size.

And you can't import or modify those tables, so I can't for instance make them MyISAM or InnoDB temporarily to get the job done. Had no problem backing them up or even deleting them. But I couldn't import backed up (modified) table schema, attempting to change the engine for those tables.

Can't find anyone else with this issue and can't find anyone (recently) explaining how to change the aria_block_size to anything besides 8192.

I also can't find any literature on why this setting default was increased so much. Went from 1024 to 4096 (which you can't actually set, it's really 8192). That's a huge difference. Was there a specific reason behind changing this. I'm sure there had to be good reason.

This prevents me from upgrading MariaDB, I'm stuck on 10.3 as the change was enforced in v10.4.

Thank you for any insight.



 Comments   
Comment by Elena Stepanova [ 2022-03-29 ]

Thanks for the report.

For 10.4-10.5, I don't see any difference in regard to aria_block_size between them and 10.3.

Even in 10.3, you cannot change the aria_block_size value for an existing database. It fails to start with

2022-03-29 15:40:12 0 [ERROR] mysqld: Got error 'Block size in control file (8192) is different than given aria_block_size: 4096' when trying to use aria control file '/data/bld/10.3/data/aria_log_control'
2022-03-29 15:40:12 0 [ERROR] Plugin 'Aria' init function returned error.

That is, the problem is not at the individual table level (and the system tables are still MyISAM), but at the aria_log_control file.
It correlates with the documentation:

Changing this requires dumping, deleting old tables and deleting all log files, and then restoring your Aria tables.

So, for 10.4/10.5 you should be able to dump the system tables, re-bootstrap your database with the new aria_block_size value, and restore the dump, without changing the table engine, just as before.

The actual problem starts from 10.6, where this change was made: MDEV-24312
It increased the length of certain columns in some system tables (columns_priv, db, global_priv, etc.), and these columns are used in indexes.

When you decrease aria_block_size value, the maximum index length also decreases, and these tables cannot be created anymore. So indeed, even fresh install isn't possible, because bootstrap already fails with

ERROR: 1071  Specified key was too long; max key length is 1233 bytes
2022-03-29 16:35:01 0 [ERROR] Aborting

I'll leave it to monty to decide what to do about it. Apparently there is a demand for aria_block_size lower than 8192, so we can't simply change the minimal value, but I don't know what other options are.

Generated at Thu Feb 08 09:47:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.