← Back to team overview

maria-developers team mailing list archive

MDEV-12179: Per-engine mysql.gtid_slave_pos: auto-configuring/packaging

 

Hello,

Suppose there is a transactional storage engine that is shipped as a loadable 
module. The examples are MyRocks and TokuDB.

I think it the default behavior for such engine after MDEV-12179 should be that 
the engine is listed in @@gtid_pos_auto_engines. 

That is, as soon as a transaction that uses the storage engine is replicated,
mysql.slave_gtid_pos{_$engine} is created for it.

gtid_pos_auto_engines makes it easy to do this manually, but it's difficult 
to achieve as default behavior.  Here's an explanation why.

Loadable storage engines are put into their separate packages, for example
mariadb-plugin-rocksdb_10.2.7+maria-zesty_amd64.deb.

The two important files in the package are :

./etc/mysql/mariadb.conf.d/rocksdb.cnf
./usr/lib/mysql/plugin/ha_rocksdb.so

The first one is a .cnf that gets included into the server's cnf file. It 
would be nice to put there something like

  SET global gtid_pos_auto_engines= CONCAT(@@gtid_pos_auto_engines, 'rocksdb');

but that is not possible (it's a .cnf not .sql)

Possible solutions:

== [Ab]use the Storage Engine API ==

Make the storage engine put itself in @@gtid_pos_auto_engines. I think
this is technically possible, but
- It's a storage engine API abuse
- how does one explain @@gtid_pos_auto_engines to the users?

== Let gtid_pos_auto_engines include unknown engine ==

- Allow @@gtid_pos_auto_engines to list unknown engines
- set the default to include all known transactional storage engines, that is
it should be :

  gtid_pos_auto_engines='InnoDB,TokuDB,RocksDB'  // (*)

and the server should allow this even if it is built without TokuDB or RocksDB

(*) -- Aria is not needed as it is not a "true" transactional storage engine as 
far as interplay with the binlog is concerned.

== Let packaging use some other solution ==

I suppose it's possible for packaging system to run some script after a package
has been installed. that script might find/adjust my.cnf file to have the
desired @@gtid_pos_auto_engines setting.
This solution might be complex and fragile, though.

Any thoughts ? 


BR
 Sergei
-- 
Sergei Petrunia, Software Developer
MariaDB Corporation | Skype: sergefp | Blog: http://s.petrunia.net/blog




Follow ups