Skip to content

Conversation

@Altahrim
Copy link
Collaborator

@Altahrim Altahrim commented Oct 3, 2024

Summary

Add a setup check to warn about tables using ROW_FORMAT=Compressed
MySQL specific
Screenshot_2024-10-08_170508
Screenshot_2024-10-08_170554

Checklist

@Altahrim Altahrim added the 3. to review Waiting for reviews label Oct 3, 2024
@Altahrim Altahrim added this to the Nextcloud 31 milestone Oct 3, 2024
@Altahrim Altahrim requested review from a team and ChristophWurst October 3, 2024 08:50
@Altahrim Altahrim self-assigned this Oct 3, 2024
@Altahrim Altahrim requested review from provokateurin, sorbaugh and yemkareems and removed request for a team October 3, 2024 08:50

public function run(): SetupResult {
if (!$this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
return SetupResult::success($this->l10n->t('You are not using MySQL'));
Copy link
Contributor

@kesselb kesselb Oct 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it makes sense to introduce something like SetupResult::skipped and then filter out the setup checks with severity = skipped by default? If you think so, I would log a feature request.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment on lines 59 to 63
$sql = 'SELECT table_name
FROM information_schema.tables
WHERE table_schema = ?
AND table_name LIKE "*PREFIX*%"
AND row_format = "Compressed";';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you not run this with our query builder?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question!
I didn't find it useful because it's only for MySQL like DBs and I am not sure I can query another database 🤔

@Altahrim Altahrim added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Oct 8, 2024
@Altahrim Altahrim force-pushed the feat/row_format_check branch from 1ea8e6a to f70f70e Compare October 8, 2024 15:13
@Altahrim Altahrim added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 15, 2024
@Altahrim Altahrim merged commit 7e99fd3 into master Oct 18, 2024
@Altahrim Altahrim deleted the feat/row_format_check branch October 18, 2024 10:00
@Altahrim Altahrim removed the 3. to review Waiting for reviews label Oct 18, 2024

return SetupResult::warning(
$this->l10n->n(
'Table %s is not using ROW_FORMAT=Dynamic. This format offers the best database performances for Nextcloud. Please change the row format to Dynamic.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plurals without %n are confusing for translators.
I would say the last line of https://docs.nextcloud.com/server/latest/developer_manual/basics/front-end/l10n.html#correct-plurals is applicable here

@Miyamoto72
Copy link

How about not only throwing a warning and point to the DB documentation, but give advice on how to fix the warning? Mysql docs do explain the differences of the formats, but it's more handy to give explicit examples (or do the conversion automatically)

@Altahrim
Copy link
Collaborator Author

@Miyamoto72 The conversion can be very long so I think it's better if administrators can run the migration at chosen time.
Maybe it could be included in a repair step later.
It's true the MySQL documentation don't give an easy command to fix the issue, but I feel it's better if administrator understand what he's doing.

However, if you have a better formulation in mind, feel free to open a pull request with it. All improvements are welcome :)

@Miyamoto72
Copy link

I reckon there's many a user running his/her own NC installation on a home server without being an IT expert (even though this would be better, I admit., including me.
So I guess including it in a repair step should be the way to go - I'm positive the contributors know how to do this while making sure there's no data loss for the users.

@rmburg
Copy link

rmburg commented Apr 27, 2025

+1 for an automated repair step.

There seems to be a large number of users presented with this message after upgrading to 31.0 (see this forum thread). I think the average user should not have to know SQL or copy a script off of the forum to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add setup warning in case row_format=compressed is still used

8 participants