-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
As log_action.idaction is just an INT, Matomo stops recording actions if idaction > 2^31 #19524
Comments
Hi @stefan-work, thanks for sharing this experience, I'm sorry to hear that this limitation caused you problems and I'm glad you managed to work around it. Database limitation are something we're currently evaluating and this sort of feedback is a valuable input to that process . 👍 |
The reason for not having idaction a BIGINT was explained here #3288 (comment) |
BIGINT keys will be required to support distributed databases, especially if using random keys. Any future support for single schema would also depend on having a large enough key space. We could have a different schema in that case, but it would be better for data migration and interoperability to standardize on BIGINT keys unless there is still a good reason not to. |
I don't think preserved disc space for keys should be that much of an issue nowadays, but just wanted to get a confirmation from @tsteur or @mattab as it seems we made the decision on purpose not to use bigint there in the past... |
For new installations only (not during upgrade - this will be covered in #19524) But there are disk space implications as we found in #3288 (comment)
Maybe another solution could be to have a console command to let people optionally trigger the column upgrade when they need it. |
Out of interest I did some rough partial estimates on the monetary cost of increasing the idaction key size. Give these cost increases in table storage only (excluding index sizes, memory use and backup): 1,000,000 actions = 38MiB = $0.004 per month increase or $0.05 per year Since data was lost because this limit was hit, perhaps in addition to a console command to upgrade the columns we could also add a simple (weekly?) scheduled task to check tables with INT primary keys and send an admin warning if they have reached 90% (?) of the keyspace along with a link to an FAQ explaining how to upgrade the columns? |
Summary
We're running Matomo in an environment with a rather high number of trackings. Recently we lost some until we noticed that log_action.idaction reached 2^31. In the log we saw that errror:
Error in Matomo (tracker): Error query: Mysqli statement execute error : Out of range value for column 'idaction' at row 1 In query: INSERT INTO matomo_log_action (name, hash, type, url_prefix) VALUES (?,CRC32(?),?,?)
We altered all relevant tables and switched to BIGINT by hand. But from my point of view it would be better if Matomo wouldn't require such a "hack" and use BIGINT as default.
Do you still consider it better to save storage and force users to modify Matomo's tables. Or wouldn't be better to revert #10569 and use BIGINT as default?
Expected Behavior
Matomo can handle that number of actions without the need to change the database schema manually.
Current Behavior
Changes to the database schema need to be done on high-traffic sites.
Possible Solution
Revert #10569
Steps to Reproduce (for Bugs)
Use Matomo until log_action.id reaches 2^31
Your Environment
The text was updated successfully, but these errors were encountered: