matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.82k stars 2.64k forks source link

Abstract database get_lock to the current PDO adapter #19643

Open bx80 opened 2 years ago

bx80 commented 2 years ago

Many distributed databases do not support the MySQL get_lock() function. In order to be able to support alternative databases in the future we need to abstract the use of get_lock() to the configured PDO adapter.

Instead of calling get_lock() directly all code should call a new getLock() method on the current PDO adapter which will allow locking to be handled differently for each database type. All Matomo PDO adapters should be implementing core/Db/AdapterInterface which can contain the new abstract method definition.

This should not change locking behavior for MySQL in any way.

jSML4ThWwBID69YC commented 1 year ago

It appears that recent MariaDB changes have broken Matomo. (https://jira.mariadb.org/browse/MDEV-30473 )

Matomo worked on Galera before that change. Is this the right issue for a long term solution to using Glaera?

bx80 commented 1 year ago

Hi @jSML4ThWwBID69YC, that's correct :+1:

This issue when implemented would add support for databases that do not support GET_LOCK() which should then allow Galera to work as before.

jSML4ThWwBID69YC commented 1 year ago

Hi @jSML4ThWwBID69YC, that's correct +1

This issue when implemented would add support for databases that do not support GET_LOCK() which should then allow Galera to work as before.

Then this is my vote for it. Despite working for over a year, my Matomo is now oddly broken.