Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't lock log_visit table to check if privilege is granted #15247

Merged
merged 1 commit into from Jan 15, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Dec 8, 2019

Instead use a table we write to less frequently. Otherwise, whenever we over privacy settings or when it is trying to delete unused actions it will lock the log_visit table for a short time that could cause random tracking issues (eg heap of requests piling up trying to write to the log_visit table).

It's only a read lock but according to MySQL it still blocks other sessions from writing

from http://www.mysqltutorial.org/mysql-table-locking/:

The session that holds the READ lock can only read data from the table, but cannot write. And other sessions cannot write data to the table until the READ lock is released. The write operations from another session will be put into the waiting states until the READ lock is released.

This method is rarely executed so I don't think it was any big issue and it should be quickly unlocked again.

Instead use a table we write to less frequently. Otherwise, whenever we over privacy settings or when it is trying to delete unused actions it will lock the log_visit table for a short time that could cause random tracking issues (eg heap of requests piling up trying to write to the log_visit table).

It's only a read lock but according to MySQL it still blocks other sessions from writing

from http://www.mysqltutorial.org/mysql-table-locking/: 
> The session that holds the READ lock can only read data from the table, but cannot write. And other sessions cannot write data to the table until the READ lock is released. The write operations from another session will be put into the waiting states until the READ lock is released.

This method is rarely executed so I don't think it was any big issue and it should be quickly unlocked again.
@tsteur tsteur added the Needs Review PRs that need a code review label Dec 8, 2019
@tsteur tsteur added this to the 4.0.0 milestone Dec 8, 2019
@tsteur tsteur changed the base branch from 3.x-dev to 4.x-dev January 14, 2020 03:59
@tsteur tsteur merged commit dac172f into 4.x-dev Jan 15, 2020
@tsteur tsteur deleted the locklogvisit branch January 15, 2020 18:55
@mattab mattab added the c: Performance For when we could improve the performance / speed of Matomo. label Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants