The state of MariaDB in the context of CoreELEC

MariaDB started as a drop-in replacement server database for MySQL many years ago but it has clearly outgrown that fame. Over the years, independent development has made it feature richer than MySQL but also incompatible in some ways.

There has also been a friendly rivalry between the two brands when it came to performance and in comparisons MariaDB came out head first for quite some time. Unfortunately, not anymore. The 10.3 branch was the last one to be fit for production environments, IMHO. The 10.4 (1) and 10.5 (2) branch were plagued by performance problems introduced by too many new features which were not mature enough for commercial use, again IMHO. 10.5.6 which is expected for October 30th, 2020, might fix the latest performance bug but judging from the ongoing discussion at the Jira ticket (2) the team is still trying to get its bearing. At the moment, I would recommend to stick with the 10.3 branch and wait for 10.6 to be released. Or go with the latest MySQL 8.x

Now, those of you who use Kodi and CoreELEC and who updated their MariaDB to 10.5 might have run into some problems. The one that is most prominent has to do with page compression. This is a feature that is now enabled by default by MariaDB and comes with a change in table structures. There is an unfortunate side effect where Kodi is concerned that may lead to video and music objects being corrupted. Users have reported titles being shown as “0” and nothing else. That issue could be fixed most of the times by simply rescraping the source folders after which the objects were shown normally again.

You may work around these problems by deactivating compression at the expense of some speed. Obviously, compressed data uses less bandwidth but more CPU which isn’t a problem nowadays. Compression is used in two places, at the application level by Kodi itself and at the server level by MariaDB.

You may switch data compression used by Kodi in advanced settings in this manner:

<advancedsettings> 
	<videodatabase>
		<compression>false</compression>
	</videodatabase>
	<musicdatabase>
		<compression>false</compression>
	</musicdatabase>
</advancedsettings>

You may switch page compression used by MariaDB (and that is the important part) via your my.cnf (Linux) or my.ini (Windows) file:

[mysqld]
innodb_compression_default=OFF

Team Kodi has tried to mitigate the issue by issuing a patch for the MariaDB database connector. Unfortunately, the patch does not adress all underlying issues and even more unfortunately, it is not compatible between Windows and Linux/Android versions. Team CoreELEC had adopted the patch at one point which led to users reporting that their library now was seemingly empty (it wasn’t but Kodi couldn’t retrieve it properly). Rescraping an empty library wasn’t possible.

Team CoreELEC decided to remove the connector patch again as to minimize having to give unnecessary support. This led to new problems for those users who had both Windows and Linux based problems and had InnoDB compression set to on. If the library was scraped by the Windows installation the objects there would be fixed but shown with “0” titles in CoreELEC. On the other hand, scraping the library in CoreELEC would lead to titles shown as “0” in Windows - again, only with InnoDB compression set active on the server. Therefore I have asked Team CoreELEC to add the patch again.

WITH the connector patch this “ping pong effect” doesn’t occur. On the other hand, WITH the connector patch some users may experience the problem that their library in CoreELEC might be shown as empty. This requires a one-time fix after which you can use your library on any Kodi OS normally: You will need to log on to your MariaDB server (for example with the bundeled GUI “HeidiSQL”) and run maintenance on all Kodi database, that is everything that has VIDEO and MUSIC in its name. I have run everything that is available one after another: “Check”, “Analyse”, “Checksum”, “Repair” and “Optimize”. MariaDB will report some errors which is normal because not all tables support all operations. You can safely ignore any errors. Afterwards, your database should be accesible again in Kodi and you should’t have any problems in the future.

For instructions on how to run maintenance on your MariaDB tables via HeidiSQL, please use Google, but frankly, if you don’t already know how to do that you probably shouldn’t use a central database solution for Kodi…

Any further support questions specifically concerning the connector patch - after it has been re-instated - will be addressed by me. Any other questions regarding the general use of MariaDB, please open a new thread so others can help.

(1) https://www.percona.com/blog/2020/07/31/how-mysql-8-0-21-and-mariadb-10-5-4-perform-in-io-bound-scenarios-on-sata-ssd-and-nvme-storage/
(2) https://jira.mariadb.org/browse/MDEV-23399

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.