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

Anonymous’s picture

Priority: Critical » Normal

There 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.

Version: 7.23 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.