Hi,
I am trying to get Magento to reliably work with a newly installed Percona XtraDB 3 node cluster. Specifics are:
Magento 2.4.5
percona-xtradb-cluster 1:8.0.29-21-1.focal
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
The configuration I have set up does currently work and Magento mostly runs fine. However I am seeing a lot of errors being reported in the cron functionality of magento and the cron tasks are not running properly.
In the Percona XtraDB logs I see various indications of some problems:
2022-09-30T13:26:15.079423Z 95974 [Warning] [MY-000000] [WSREP] Percona-XtraDB-Cluster doesnât recommend use of GET_LOCK with pxc_strict_mode = PERMISSIVE
2022-09-30T13:26:15.079468Z 95974 [Note] [MY-000000] [WSREP] MDL conflict db= table=my-prefix|cron_703fd9d88e47d6ee07c6d281af86adb5 ticket=10 solved by abort
2022-09-30T13:26:15.080297Z 95974 [Warning] [MY-000000] [WSREP] Percona-XtraDB-Cluster doesnât recommend use of RELEASE_LOCK with pxc_strict_mode = PERMISSIVE
Now, the GET_LOCK and RELEASE_LOCK warnings I am familiar with and have always had to set the cluster in a PERMISSIVE state (SET GLOBAL pxc_strict_mode=PERMISSIVE; on each node). I realise this is not ideal, but have never found a better solution for this.
What is more concnering though is the
2022-09-30T13:26:15.079468Z 95974 [Note] [MY-000000] [WSREP] MDL conflict db= table=my-prefix|cron_703fd9d88e47d6ee07c6d281af86adb5 ticket=10 solved by abort
Note - I am suspicious that this may be the cause of the errors reported in the magento cron result responses.
I have tried setting the wsrep_debug variable (SET GLOBAL wsrep_debug=SERVER;) on the main node that I have magento talking to (although I typically have a load balanced configuration with haproxy I have set up the configuration so that magento always talks to one specific node and the other nodes are considered backups in case the primary goes down). Now this does generate a lot of extra information but I am not sure what this is telling me!
I get quite afew log entried like this:
2022-09-30T13:32:30.177531Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:30.178397Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
and also:
2022-09-30T13:32:14.519241Z 96336 [Note] [MY-000000] [WSREP] Thread holds MDL locks at TOI begin: ANALYZE TABLE xtento_xtcore_config_data
96336
2022-09-30T13:32:14.519299Z 96336 [Note] [MY-000000] [WSREP] Executing Query (ANALYZE TABLE xtento_xtcore_config_data
) with write-set (-1) and exec_mode: local in TO Isolation mode
2022-09-30T13:32:14.519353Z 96336 [Note] [MY-000000] [WSREP] wsrep: initiating TOI for write set (-1)
2022-09-30T13:32:14.519393Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.519761Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.521223Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.521250Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.522364Z 96336 [Note] [MY-000000] [WSREP] Query (ANALYZE TABLE xtento_xtcore_config_data
) with write-set (91523284) and exec_mode: toi replicated in TO Isolation mode
2022-09-30T13:32:14.522381Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.522456Z 96336 [Note] [MY-000000] [WSREP] wsrep: TO isolation initiated for write set (91523284)
2022-09-30T13:32:14.522921Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.523904Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.525028Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.525400Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.526672Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.526891Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.528034Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.528181Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.529697Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.529912Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
2022-09-30T13:32:14.531318Z 93824 [Note] [MY-000000] [WSREP] wsrep_commit_empty(93824)
2022-09-30T13:32:14.531378Z 96336 [Note] [MY-000000] [WSREP] TO END: 91523284: ANALYZE TABLE xtento_xtcore_config_data
2022-09-30T13:32:14.531403Z 96336 [Note] [MY-000000] [WSREP] wsrep: completed TOI write set (91523284)
2022-09-30T13:32:14.531418Z 96336 [Note] [MY-000000] [WSREP] Setting WSREPXid (InnoDB): 67833533-30bc-11ec-8c11-7e8198aaf81e:91523284
2022-09-30T13:32:14.531433Z 96336 [Note] [MY-000000] [WSREP] Updating WSREPXid: 67833533-30bc-11ec-8c11-7e8198aaf81e:91523284
2022-09-30T13:32:14.532072Z 92714 [Note] [MY-000000] [WSREP] wsrep_commit_empty(92714)
But I am unsure if this is helpful in diagnosing the issues at the moment.
If anyone could help with how I could proceed to debug / any ideas on how to fix these kind of issues it would be most appreciated.
Many thx!