Improve process of adding new custom variables #8555
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
not-in-changelog
For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone
Currently it works so that we have 2 commands - one to add/delete custom variables and one to check if everything is OK. My suggestion is to improve the process of adding new custom variables.
Use case
Currently adding new custom vars means more or less iterating log_* tables. If there are discrepancies between tables (in number of custom vars), Piwik interface displays errors and archiving is not working. The only good thing is fact that tracker still works.
When this can happen
When there's a really big database and it takes around 24 hours to alter log_link_visit_action table
Why this is important?
We want to assure zero downtime (archiving, interface). It is doable, especially given that there are HOT alters in MariaDB 10+ (so we don't have to disable DB replication to do this).
Proposed solution
Let's make Piwik a little bit more resistant:
https://github.com/piwik/piwik/blob/master/plugins/CustomVariables/CustomVariables.php#L79
I'd start with 1 here (because that's the minimum value - one may just want to change the number of custom variables from 5 to 1) and then check what's the minimum number of columns in all 3 tables.
The text was updated successfully, but these errors were encountered: