You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding a column to the filecache is super time consuming (depending on db) #22747
The resulting ALTER TABLE for the added checksum column in OC9 will create a temp table with the same columns as the filecache, add the colum, COPY the table content and finally rename it and delete the original table. Big installations will experience a very long downtime as we have seen today with a huge activity table change when updating to oc 8.2.2.
yes. this is actually the wanted behavior. we want to simulate the upgrade because we actually touch the real table. the reason is that we had a ton of bugs before triggered by combinations of specific db types and servers with specific limitations. certain sometimes broken entries in the table, size limitations ir the combination of all if that.
so we destroyed user data in the past.
the fix is to copy the table first and test it. it is accepted that this takes some times but is better then destroying the database.
experienced admin can skip this if they tested the upgrade manually befores
the fix is to copy the table first and test it. it is accepted that this takes some times but is better then destroying the database.
It's not our code that copies the table. It's mysql that copies the table. We run the upgrade simulation steps -> that itself triggers a copy of the same table in mysql (1) and apply the schema update (ALTER TABLE) which itself will copy the table internally(2). Then we run the same on the actual code (3+4).
This means we copy the whole table 4 times instead of 1 time. This totally kills bigger installations on mysql.
I guess we either need a way to figure out why mysql copies the table sometimes when a column is added (I guess this is the case when the whole table doesn't fit in memory).
@karlitschek@DeepDiver1975 You asked me about this. It seems that I was wrong here. Today I noticed that the complete activity table was copied while running the alter table statement to add two columns (owncloud/activity@0470887).
Add the following to update notification in Web UI for stable8.2 && MySQL && oc_filecache ahs more than 200k entries?:
According to your filecache table size upgrade might take too long. You can execute the following query on your database to speedup the upgrade process: ALTER TABLE oc_filecache ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions; `
I think we should add a warning to the web ui and the cli if you have more then 200k. Please check the original updater 2.0 issue for the right place in the flow where we have the hint about the length of the upgrade.
We should use this text instead:
You have an ownCloud installation with over 200.000 files so the upgrade might take a while. The recommendation is to use the command-line instead of the web interface for big ownCloud servers. Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE oc_filecache ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions; `
Not. Please show the hint only if using mysql.
Please show the CLI hint only in the web ui.
Activity
butonic commentedon Mar 1, 2016
Postgres may omit rebuilding the table if no default value is specified: http://www.postgresql.org/docs/9.5/static/sql-altertable.html#AEN72358
karlitschek commentedon Mar 1, 2016
yes. this is actually the wanted behavior. we want to simulate the upgrade because we actually touch the real table. the reason is that we had a ton of bugs before triggered by combinations of specific db types and servers with specific limitations. certain sometimes broken entries in the table, size limitations ir the combination of all if that.
so we destroyed user data in the past.
the fix is to copy the table first and test it. it is accepted that this takes some times but is better then destroying the database.
experienced admin can skip this if they tested the upgrade manually befores
MorrisJobke commentedon Mar 1, 2016
It's not our code that copies the table. It's mysql that copies the table. We run the upgrade simulation steps -> that itself triggers a copy of the same table in mysql (1) and apply the schema update (
ALTER TABLE) which itself will copy the table internally(2). Then we run the same on the actual code (3+4).This means we copy the whole table 4 times instead of 1 time. This totally kills bigger installations on mysql.
I guess we either need a way to figure out why mysql copies the table sometimes when a column is added (I guess this is the case when the whole table doesn't fit in memory).
MorrisJobke commentedon Mar 1, 2016
@karlitschek @DeepDiver1975 You asked me about this. It seems that I was wrong here. Today I noticed that the complete activity table was copied while running the alter table statement to add two columns (owncloud/activity@0470887).
MorrisJobke commentedon Mar 1, 2016
We should re-evaluate the add of the column to the file cache because this could add a serious problem.
Ref #21997
@karlitschek @DeepDiver1975 Sorry - I did a mistake by stating that this will not be a problem. 😢
MorrisJobke commentedon Mar 1, 2016
@PVince81 @nickvergessen I remind that Frank said that you tested this and it worked fine. What exactly was the test scenario?
PVince81 commentedon Mar 1, 2016
I think @karlitschek tested it himself and it was fast.
DeepDiver1975 commentedon Mar 1, 2016
adding sev1 - this needs to be sorted out
MorrisJobke commentedon Mar 1, 2016
I updated my description above - it's a ratio of 1 to 4.
PVince81 commentedon Mar 1, 2016
To clarify: this report is NOT about simulated update.
It's about the ALTER TABLE that happens afterwards.
40 remaining items
MorrisJobke commentedon Mar 21, 2016
Because it's too late.
VicDeo commentedon Mar 21, 2016
@PVince81 @DeepDiver1975 So, what finally needs to be done?
Add the following to update notification in Web UI for stable8.2 && MySQL && oc_filecache ahs more than 200k entries?:
PVince81 commentedon Mar 22, 2016
Sounds good to me. @karlitschek @DeepDiver1975 @butonic @MorrisJobke what do you think ?
karlitschek commentedon Mar 22, 2016
we discussed this and we don't want to have a new table for the. we optimize for production speed instead of upgrade speed
karlitschek commentedon Mar 22, 2016
I think we should add a warning to the web ui and the cli if you have more then 200k. Please check the original updater 2.0 issue for the right place in the flow where we have the hint about the length of the upgrade.
We should use this text instead:
You have an ownCloud installation with over 200.000 files so the upgrade might take a while. The recommendation is to use the command-line instead of the web interface for big ownCloud servers. Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE oc_filecache ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions; `
Not. Please show the hint only if using mysql.
Please show the CLI hint only in the web ui.
Does this make sense?
VicDeo commentedon Mar 23, 2016
@karlitschek shouldn't this notice be added to 8.2 in order to be displayed before any action takes place?
karlitschek commentedon Mar 23, 2016
I think 9.0.x is fine
nickvergessen commentedon Mar 23, 2016
But the update to 9.0.x is the one causing the troubles?! 😕
MorrisJobke commentedon Mar 23, 2016
And then already the new 9.0.x code is available before the upgrade step has run. So this should be fine ;)
PVince81 commentedon Apr 19, 2016
So if I understand well the warning has been added 9.0.1, closing hence.
Please reopen if you think there is something left to do.
lock commentedon Aug 4, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.