MariaDB / mariadb-docker

Docker Official Image packaging for MariaDB
https://mariadb.org
GNU General Public License v2.0
759 stars 438 forks source link

Install rocksdb plugin #486

Open ifel opened 1 year ago

ifel commented 1 year ago

RocksDB engine is officially supported by MariaDB (https://mariadb.com/kb/en/getting-started-with-myrocks/), but the image does not have the plugin installed. Install it, so users will be able to load it if it's needed.

grooverdan commented 1 year ago

Yes, also see: https://mariadb.org/installing-plugins-in-the-mariadb-docker-library-container/

There's a big tradeoff between basic images and all plugins.

There was some discussion about making a separate image layer for plugins like RocksDB.

ifel commented 1 year ago

Yes, also see: https://mariadb.org/installing-plugins-in-the-mariadb-docker-library-container/

There's a big tradeoff between basic images and all plugins.

There was some discussion about making a separate image layer for plugins like RocksDB.

This makes total sense. Thank you. The link describes different ways of enabling plugins that already baked into the image, but not loaded/enabled by default. The problem with the rocksdb one, it's not in the image, so even if user wants it to be loaded and enabled, they cannot do this, as the plugin (so file) does not exist in the image. This PR basically installs the plugin into the image. This increases the image size by ~6.7MB, it's just 1% of the overall image size - 481MB.

The problem was, it was installed upon server startup (because the package adds a config file with plugin installation), I've modified the Docker file to remove the file from the image, so now, it does not get installed on the server start up, but can be installed by user.

MariaDB [(none)]> SHOW PLUGINS SONAME LIKE 'ha_rocks%';
+-----------------------------+---------------+--------------------+---------------+---------+
| Name                        | Status        | Type               | Library       | License |
+-----------------------------+---------------+--------------------+---------------+---------+
| ROCKSDB                     | NOT INSTALLED | STORAGE ENGINE     | ha_rocksdb.so | GPL     |
| ROCKSDB_CFSTATS             | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_DBSTATS             | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_PERF_CONTEXT        | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_PERF_CONTEXT_GLOBAL | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_CF_OPTIONS          | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_COMPACTION_STATS    | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_GLOBAL_INFO         | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_DDL                 | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_SST_PROPS           | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_INDEX_FILE_MAP      | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_LOCKS               | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_TRX                 | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_DEADLOCK            | NOT INSTALLED | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
+-----------------------------+---------------+--------------------+---------------+---------+
14 rows in set (0.085 sec)

MariaDB [(none)]> INSTALL SONAME 'ha_rocksdb';
Query OK, 0 rows affected, 1 warning (2.088 sec)

MariaDB [(none)]> SHOW PLUGINS SONAME LIKE 'ha_rocks%';
+-----------------------------+--------+--------------------+---------------+---------+
| Name                        | Status | Type               | Library       | License |
+-----------------------------+--------+--------------------+---------------+---------+
| ROCKSDB                     | ACTIVE | STORAGE ENGINE     | ha_rocksdb.so | GPL     |
| ROCKSDB_CFSTATS             | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_DBSTATS             | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_PERF_CONTEXT        | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_PERF_CONTEXT_GLOBAL | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_CF_OPTIONS          | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_COMPACTION_STATS    | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_GLOBAL_INFO         | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_DDL                 | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_SST_PROPS           | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_INDEX_FILE_MAP      | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_LOCKS               | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_TRX                 | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
| ROCKSDB_DEADLOCK            | ACTIVE | INFORMATION SCHEMA | ha_rocksdb.so | GPL     |
+-----------------------------+--------+--------------------+---------------+---------+
14 rows in set (0.002 sec)
grooverdan commented 1 year ago

@ifel good points. Thanks for measuring.