Piwik 3.0.3 breaks MySQL Group Replication

When MySQL 5.7.17 is running in group replication (a high-availability feature introduced in MySQL 5.7.17), all tables are required to have a primary key. Installing Piwik 3.0.3 on MySQL 5.7.17 running in a group replication breaks the group because all of the Piwik tables do not contain a primary key. The solution is to add a primary key to the three Piwik tables that do not contain primary keys:

  • piwik_log_profiling
  • piwik_plugin_setting
  • piwik_site_setting

If possible, please make this change in Piwik 3.0.4 so we may continue with our high-availability setup. Thanks in advance.

Reference: https://dev.mysql.com/doc/refman/5.7/en/group-replication-requirements.html
"Primary Keys. Every table that is to be replicated by the group must have an explicit primary key defined. Primary keys play an extremely important role in determining which transactions conflict by identifying exactly which rows each transaction has modified."

Thanks for the report. Created a ticket in Piwik breaks MySQL Group Replication · Issue #11673 · piwik/piwik · GitHub - feel free to subscribe there.

Hi Matthieu,

This is a duplicate of:

We check 11596 often. :slight_smile:

Jason

there’s now a pull request opened, please test it and report feedback :+1:

Tests out ok (new columns created), but we did not test out the upgrade piece.

Just tested the pull with Piwik v3.0.4 and it works well (we renamed the updated 3.0.4 in order to test the code). The create and the Piwik update piece both work with MySQL Group Replicate and MySQL InnoDB Cluster.

Great thanks for letting us know!