-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
joomla 4.2.9 com_finder Storage Engine 'memory' unknown on modifying articles on innodb tables #40368
Comments
Hello, If you do not use search on your site you can disable Content => Finder plugin. |
Yes my server doesn't support MEMORY engine, but i read on the joomla forum that innodb table would work, slower but works. Is there a way to choose the type of the engine for the search function ? Claudio This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
TBH I do not know about such posibility |
ALTER TABLE my_table ENGINE = InnoDB; should work |
The problem is all the tables show ENGINE = Innodb, bone is 'Memory' and all the search features works with no error, the erro appears only when an article is modified, but repeat the modifies will be saved but this error appears This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
This is the DB tables and the engine mysql> SELECT TABLE_NAME, ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'dbname'; None is 'Memory' all are InnoDB Thanks This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
I tried also to create a new article and it is not saved same error displayed This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
hmhm, that probably due to this code joomla-cms/administrator/components/com_finder/src/Indexer/Indexer.php Lines 624 to 625 in 7a8b628
joomla-cms/administrator/components/com_finder/src/Indexer/Indexer.php Lines 967 to 1005 in 7a8b628
It in use while indexing |
Do you think i can comment out the row 625 ??? Or it needs a rework ? This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
Note: this installation is working on another host with same Percona Cluster but on joomla 3.9.25 with php php 7.3, while the new joomla is 4.2.9 with php 8.1.2 same configuration on both hosts This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
Well, you can try, no one can forbid you to do so :)
Currently I don't know how it can be done differently, to cover your case.
In Joomla 3 this is dummy method joomla-cms/administrator/components/com_finder/helpers/indexer/indexer.php Lines 570 to 573 in a2a0fac
|
We could add a check to the toggleTables method if "MEMORY" is in the list of available engines returned by a "SHOW ENGINES" SQL statement. The check should be just after the check if we are on MySQL and should save the result in a static variable or a class variable so it is not checked every time. @Fedik what do you think? |
That could work |
Unfortunately the "SHOW ENGINES" SQL statement doesn't support a WHERE clause like the "SHOW COLUMNS" does, so we cannot check for a specific engine, we can only get them all and then check the result. We could also do a "SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE |
For me would be better to add an option or a variable to TRUE or FALSE in the configuration of joomla or for the component itself This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
hmhm, or maybe can just wrap current query code in to try/cactah, and set "is supported" flag on first run/crash. |
Could also be a way but then we should try to catch the right exception. @claudiosoprano Question: How have you managed to install Joomla with a database server which doesn't support the "MEMORY" engine? I would expect the installation to fail here https://github.com/joomla/joomla-cms/blob/4.3-dev/installation/sql/mysql/extensions.sql#L607 . Or have you updated from 3.10? This would work because there is no change to the "MEMORY" engine on update, so there is no error on update. |
This comment was marked as outdated.
This comment was marked as outdated.
@richard67 I think it also possible to edit that file before installation. But not like this is recommended anyway :) |
@Fedik This will fix the issue when running on a database which doesn't support the MEMORY engine. But that can only be the case on a site updated from 3.10. Installation of a new site will fail. @Hackwar What do you think? We could change the extensions.sql for mysql so it installs the table with the InnoDB engine and switching to MEMORY engine would be done in PHP only, and only when it's supported. |
@Fedik I still would prefer to check with "SHOW ENGINES" because I'd not like to catch all kinds of exceptions. I could make a PR with that and additionally other changes for making new installations work on MySQL (or MariaDB) without MEMORY engine support. |
I do not mind, if you think that will be better, we can close my PR anytime ;) |
Yes, the correct solution would be to install as innodb, then after the SQL files are executed to change the engine to memory if supported and to extend the check in the toggle function to check that properly with the SHOW ENGINES command. |
In J3 the toggle function isn't empty either. The class is extended by another, DB specific class. Since the changes in J4 have been reduced to nearly nothing, that distinction has been removed. |
@Hackwar And what do you think about the fact that in extensions.sql we use the MEMORY storage engine for these 2 tables, so making a new installation on a MySQL (or MariaDB) which does not support that engine will fail, wile in the update SQL script where the finder stuff is touched, the table is not touched either, so if someone has set it to InnoDB it will remain like this until the indexer runs and then fail with the exception? |
install as innodb, then ... change the engine to memory if supported |
We updated from v3.x on a cloned server that used a single MYSQL server, then backupped with akeeba and restored with kickstart.php using the Percona XtraDB Cluster with no problems or errors The problem is for example with mysql that show engines; will always answer that memory engine is supported because mysql itself use the MEMORY storage engine and it can't be disabled https://forums.mysql.com/read.php?92,635909,635909#msg-635909 but Percona Xtradb Cluster (either using MariaDV or Mysql) will not support this engine, but mysql inside will always show mysql> show engines; and maybe also some other DBMS could answer in this way. For this i asked for a variable configuration to set FALSE or TRUE to disable or enable the memory table engine Claudio This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
I strongly suggest to not add yet another manual option here. This has to be figured out automatically by Joomla as @Fedik did. |
the query are two, i posted both in the Your text to link here... This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/40368. |
Okay, I will reopen the PR, that fix for |
I think that can be done with a different PR. |
@Hackwar Should we lave this issue open for the installation thing (which is buried in a comment below the initial post? Or shall we close it and make a new issue especially for the installation thing? |
Closing as having a pull request. See #40373 . |
Well the thing is that it is not even possible to disable the MEMORY engine on a MySQL or MariaDB because it is also used internally by the database server. The limitation comes from the replication of the Galera Cluster. See the first limitation listed on this page https://mariadb.com/kb/en/mariadb-galera-cluster-known-limitations/
This explains why @claudiosoprano could install Joomla on a single database without replication. |
All right @richard67, it is a limitation of Galera Cluster replication, mysql and mariadb support it, this is because SHOW ENGINES; command shows storage engine memory is supported but then it will not work on the Cluster, while on a single server all works like a charms, but with the patch for the PR it is working now. Thanks anyway for the patch, i suppose it will be useful for others DBMS that don't use MEMORY storage engine. |
The proposed fix is not enough. The ALTER TABLE instruction on Galera clusters does not fail if the table is empty (as it is on a new installation), it only fails if the table contains at least a record. If the ALTER TABLE succeeds, MySQL returns an error at the first insert into the table. The detection logic should be improved. |
Steps to reproduce the issue
Modify an article
Expected result
no errors if it successed
Actual result
modifies are recorded but an error is throw
System information (as much as possible)
Percona mysql xtradb cluster with galera
php 8.1
Additional comments
When i try to modify an article, it get modified but an error is displayed on the screen with the message:
Save failed with the following error: Unknown storage engine 'MEMORY'
I checked all the joomla DB tables and they are all InnoDB
The text was updated successfully, but these errors were encountered: