`SELECT FOR UPDATE` in master-master mysql setup
Generally, it is considered a very bad idea to write to both masters in master/master replication, unless you are writing to different schemas.

MySQL replication is asynchronous (MySQL 5.5 has "semi-synchronous" replication, but it's still asynchronous in practice).  There is no mechanism to synchronize locks or detect conflicts between hosts.

Consider what happens in this situation

master1&gt; BEGIN;
master1&gt; SELECT * FROM table WHERE id = 7 FOR UPDATE;
master1&gt; UPDATE talbe SET col = "Newton" WHERE id = 7;

master2&gt; BEGIN;
master2&gt; SELECT * FROM table WHERE id = 7 FOR UPDATE;
master2&gt; UPDATE table SET col = "Aaron" WHERE id = 7;

master1&gt; COMMIT;
master2&gt; COMMIT;


Depending on timing, replication lag, and whether you have ROW or STATEMENT based replication, you might end up with different data on different hosts.  Certainly, master1's FOR UPDATE will not lock the rows on master2 and vice versa, thus negating the utility of FOR UPDATE (which is to be avoided).

In your situation you could, at best, end up with broken replication and at worst end up with silent data sync issues between the servers.