Topic on Project:Support desk

Installation using percona cluster

7
Summary by MarkAHershberger
Scejja (talkcontribs)

I've tried to install Mediawiki 1.31 in Ubuntu 16.04 with apache 2.4.18, php 7.0.30, using a 3 machine percona mysql cluster (5.7.22). The cluster is working ok, but when installation wizard is about to finish, this error appears.

Incluyendo extensiones… hecho

Configurando la base de datos… hecho

Creando tablas… hecho

Creando el usuario de la base de datos… hecho

Llenando la tabla interwiki predeterminada… hecho

Iniciando las estadísticas… hecho

Generando claves secretas… hecho

Evitar ejecutar actualizaciones innecesarias… hecho

Creando la cuenta de usuario del administrador… hecho

Creando página principal con contenido predeterminado… falló

Información

No se pudo insertar la página principal: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: SELECT GET_LOCK('695f25141b5213ec078ceed7dbde8264bc651753', 30) AS lockstatus Function: ApiStashEdit::checkCache Error: 1105 Percona-XtraDB-Cluster prohibits use of GET_LOCK with pxc_strict_mode = ENFORCING (10.0.2.80)

Percona cluster runs using pxc_strict_mode=ENFORCING, and one of its limitations is explicit table locking, which seems to be what installation is trying to use here.

https://www.percona.com/doc/percona-xtradb-cluster/LATEST/features/pxc-strict-mode.html

If I change pxc_strict_mode to permissive, will the installation be consistent over the cluster?

Maybe there are other situations when get lock or other Percona limitation is needed.

Is Mediawiki installation compatible with Percona xtradb cluster?

Any help please!! thanks in advance

Juanjo

MarkAHershberger (talkcontribs)

I do not know the answer to your question, but it is an important question to answer. I've filed a task for it.

MarkAHershberger (talkcontribs)

Also, since you seem to want answers to Percona-specific question, you might ask in the Percona forums.

Bawolff (talkcontribs)

The lock is acquired for application level locking, so its not actually used for DB stuff. Thus it should be perfectly consistent even in a replicated setup (At least for that particular usage of GET_LOCK in ApiStashEdit).

See includes/api/ApiStashEdit.php line 184.

Scejja (talkcontribs)

If I put pxc-strict-mode=PERMISSIVE for the last part of the installation finish ok.

If I shutdown the master cluster node, main website page is still shown, so seems to be ok. I will do some more tests.

But following database recommendations I put it back to ENFORCING. Basically they say that this mode was "specifically implemented to catch issues like tables without PRIMARY KEYS", I will see if I can install other extensions I need.

Just in case someone use Mediawiki with this cluster, I put it on Percona forums too.

Thanks a lot!!

46.222.178.216 (talkcontribs)

Also in ApiStashEdit, there is another GET_LOCK when saving a simple page (see error below). It seems to be the same situation as before, but I do not really know the source code.

If I put the database in PERMISSIVE mode, it seems to be working, every node says that is synced when runing clustercheck, or in variable wsrep_local_state_comment. If I start only one database node the page content is always the last edited content. Doing this for each node is the same.

[6b3b7a3854c3c202b3f9b747] /index.php?title=Mi_p%C3%A1gina&action=submit Wikimedia\Rdbms\DBQueryError from line 1457 of /var/www/mediawiki/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: SELECT GET_LOCK('d5a201ea6c014b0b414bbf94a7854d8b738e73a8', 30) AS lockstatus

Function: ApiStashEdit::checkCache

Error: 1105 Percona-XtraDB-Cluster prohibits use of GET_LOCK with pxc_strict_mode = ENFORCING (10.0.2.90)

Backtrace:

#0 /var/www/mediawiki/includes/libs/rdbms/database/Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)

#1 /var/www/mediawiki/includes/libs/rdbms/database/Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#2 /var/www/mediawiki/includes/libs/rdbms/database/DatabaseMysqlBase.php(1222): Wikimedia\Rdbms\Database->query(string, string)

#3 /var/www/mediawiki/includes/api/ApiStashEdit.php(288): Wikimedia\Rdbms\DatabaseMysqlBase->lock(string, string, integer)

#4 /var/www/mediawiki/includes/page/WikiPage.php(2070): ApiStashEdit::checkCache(Title, WikitextContent, User)

#5 /var/www/mediawiki/includes/page/WikiPage.php(1655): WikiPage->prepareContentForEdit(WikitextContent, NULL, User, string, boolean)

#6 /var/www/mediawiki/includes/EditPage.php(2214): WikiPage->doEditContent(WikitextContent, string, integer, boolean, User, string, array, integer)

#7 /var/www/mediawiki/includes/EditPage.php(1506): EditPage->internalAttemptSave(array, boolean)

#8 /var/www/mediawiki/includes/EditPage.php(652): EditPage->attemptSave(array)

#9 /var/www/mediawiki/includes/actions/EditAction.php(60): EditPage->edit()

#10 /var/www/mediawiki/includes/actions/SubmitAction.php(38): EditAction->show()

#11 /var/www/mediawiki/includes/MediaWiki.php(500): SubmitAction->show()

#12 /var/www/mediawiki/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)

#13 /var/www/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#14 /var/www/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#15 /var/www/mediawiki/index.php(42): MediaWiki->run()

#16 {main}

These are the log warnigns:

2018-07-30T08:51:05.171655Z 95 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of GET_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:05.343432Z 94 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of GET_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:05.343699Z 94 [Note] WSREP: MDL conflict db= table=e478d062c6a2125d8427745eebdb33097053f507 ticket=MDL_EXCLUSIVE solved by abort

2018-07-30T08:51:05.560095Z 95 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of RELEASE_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:05.562135Z 94 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of RELEASE_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:05.753378Z 94 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of DML command on a table (webane.searchindex) that resides in non-transactional storage engine with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:05.848151Z 94 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of GET_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:05.857637Z 94 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of RELEASE_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:07.108108Z 98 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of GET_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:07.231709Z 98 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of GET_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:07.455051Z 98 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of RELEASE_LOCK with pxc_strict_mode = PERMISSIVE

2018-07-30T08:51:07.456148Z 98 [Warning] WSREP: Percona-XtraDB-Cluster doesn't recommend use of RELEASE_LOCK with pxc_strict_mode = PERMISSIVE

Selected engine was InnoDB on installation.

Is safe to use this cluster with this warnigns?

Thanks

Juanjo

89.250.45.11 (talkcontribs)

I hit this problem on a Percona cluster too with a migrated system - I couldn't edit an article.

Since our wiki is lightly used, I hacked /includes/libs/rdbms/database/DatabaseMysqlBase.php and changed some methods - lockIsFree (to return true), lock (to return false) and unlock (to return false).

This let me edit articles.

Reply to "Installation using percona cluster"