Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I saw in the Galera's doc that locking is not supported.
Is there a way to remove locking in Drupal in order to make it work well with galera ?
Thanks.
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedThere are two types of locking in RDBMS - optimistic and pessimistic. Pessimistic locking is what is used in most databases. All locks that are thought to be needed are acquired before making the transaction. In a multi-node environment, that means acquiring locks across the cluster. What Galera does is use optimistic locking across the cluster to speed up replication while using pessimistic locking on the node where the write transaction is taking place.
Basically, that means that the trade-off that you've got to make to get *very* fast replication across a cluster is the number of your write nodes is limited.
If only one node in the cluster is accepting writes from the application(s) talking to a particular database, you won't have deadlocks. I've got a couple of sites that see over a hundred thousand page views per day (social sites, so a respectable amount of writes) on a Percona XtraDB 3-node cluster (Galera is the clustering part)... and no deadlock issues. But HAProxy is set up to send all writes (and causal reads) to one node while non-causal reads are balanced across all three nodes.