Skip to content

mysql_adaptor abort action

Jan Engelhardt edited this page Apr 29, 2021 · 2 revisions

Applies to releases before: gromox-0.22

Applies to snapshots before: gromox-0.21-68-gd784188d

Apr 28 09:18:30 mail delivery[13174]: [mysql_adaptor]: Current schema n71. Update available: n74. Configured action: abort

A number of service processes load the mysql_adaptor(4gx) plugin (file libgxs_mysql_adaptor.so) to access the user database. The plugin is also in charge of upgrading the table schema (i.e. the definition shown by SHOW CREATE TABLE users). It would be detrimental if all instances of the plugin (in whatever processes it runs in) would attempt to execute ALTER TABLE statements at the same time. On system boot, all services would however start in parallel, and to avoid concurrent ALTER statements from being issues, the default action for the mysql_adaptor plugin is to not execute any schema upgrades.

MariaDB/MySQL provides no practical mechanism known to us to obtain a global write lock. We could synthesize a global lock by abusing a table row/column as a semaphore, and using transactions to effect atomic exchanges, but if the database connection were to abort, that semaphore would not be reset.

Anyway, for these reasons, the default value of the schema_upgrades config directive is set to skip. You have two options:

  • Execute gromox-dbup -U manually to perform the upgrade, or
  • Designate exactly one process — gromox-http in this case — that is allowed to perform the upgrade, by adding schema_upgrades = host:abc.example.de to /etc/gromox/mysql_adaptor.cfg, whereby the hostname (abc.example.de here) should match whatever value you have in http.cfg as the value for host_id.
Clone this wiki locally