OllieJones / index-wp-mysql-for-speed

A plugin to add useful indexes to your WordPress installation's MySQL database.
GNU General Public License v2.0
125 stars 10 forks source link

Fatal error: #52

Closed agenceKanvas closed 1 year ago

agenceKanvas commented 1 year ago

Hi !

Using wp-cli or the option in the backoffice, I have this error :

Index WP MySQL For Speed 1.4.11
Versions  Plugin:1.4.11 MySQL:10.5.15-MariaDB-0+deb11u1 WordPress:6.1 WordPress database:53496 php:8.1.11
Fatal error: Uncaught ImfsException: [0]: Temporary file write failure in ALTER TABLE mrsa_postmeta ADD UNIQUE KEY meta_id (meta_id), DROP PRIMARY KEY, ADD PRIMARY KEY (post_id, meta_key, meta_id), DROP KEY meta_key, ADD KEY meta_key (meta_key, meta_value(32), post_id, meta_id), ADD KEY meta_value (meta_value(32), meta_id), DROP KEY post_id/**imfs-query-tag*871520279*/

  thrown in /www/wp-content/plugins/index-wp-mysql-for-speed/code/imsfdb.php on line 339

The table has 8 882 029 rows, approximately.

Anything I can do to help debbuging that ?

Thanks a lot !

OllieJones commented 1 year ago

Thanks for the report. It means your MySQL / MariaDB server ran out of temporary SSD (or hard-drive) space while rekeying your postmeta table. To do that rekeying operation, the database server makes a copy of the table in its temporary storage area, and this means the temporary storage area is too small for the table.

It causes no harm. Your site continues to function normally, just without the benefit of the high performance keys on that table.

Often, MySQL / MariaDb instances on Linux or other UNIX-like OSs are installed with their temporary directory set to /tmp. On some OSs this is a small partition or even a RAMdisk. If that's the case on your system, you can fix it by changing the temporary directory to /var/tmp.

Is it your problem? Find out by issuing this SQL statement: SHOW GLOBAL VARIABLES LIKE 'tmpdir'; You can read about this here and here.

If so, you'll need to update a MySQL .conf file so it contains this line, and then restart your database server.

tmpdir = /var/tmp

agenceKanvas commented 1 year ago

Thanks a lot ! I had the idea that it could come from that. I've asked my host to solve that problem with tmp. Can't wait to finalize that. Thanks a lot, I will add more info when it's done !

agenceKanvas commented 1 year ago

I've uploaded my monitor in case it's useful !

rjasdf commented 1 year ago

agenceKanvas - The tmpdir problem points out that certain maintenance operations (that may happen at major WP releases) could fail.  The simple rule of thumb is that tmpdir needs to be bigger than the largest of your WP tables -- or rather the largest at the time when it becomes necessary.  The complicated part of that rule is finding the disk space taken by each table. Ollie -- Perhaps something to that effect could be added to the Monitor? Rick Jamesemail: @.***

On Tuesday, November 8, 2022 at 05:40:02 AM PST, Oliver Jones ***@***.***> wrote:  

Thanks for the report. It means your MySQL / MariaDB server ran out of temporary SSD (or hard-drive) space while rekeying your postmeta table. To do that rekeying operation, the database server makes a copy of the table in its temporary storage area, and this means the temporary storage area is too small for the table.

It causes no harm. Your site continues to function normally, just without the benefit of the high performance keys on that table.

Often, MySQL / MariaDb instances on Linux or other UNIX-like OSs are installed with their temporary directory set to /tmp. On some OSs this is a small partition or even a RAMdisk. If that's the case on your system, you can fix it by changing the temporary directory to /var/tmp.

Is it your problem? Find out by issuing this SQL statement: SHOW GLOBAL VARIABLES LIKE 'tmpdir'; You can read about this here and here.

If so, you'll need to update a MySQL .conf file so it contains this line, and then restart your database server.

tmpdir = /var/tmp

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>