On 29/10/10 05:51, Stewart Smith wrote:
https://bugs.launchpad.net/drizzle/+bug/668147
with https://bugs.launchpad.net/drizzle/+bug/668143 fixed and
http://bugs.mysql.com/bug.php?id=52663 (so you'll see this happen) - you can
see drizzleslap will produce transactions that will deadlock.
proposed fixes
1) update keys in order so that it could never deadlock.
or
2) handle deadlock/lock wait and don't treat it as fatal error.
What are peoples thoughts? is somebody wanting to take up the challenge
to fix drizzleslap?
OK, to help with this I will attempt to give a better example than the
MySQL bug as to why the old behaviour is bad:
drizzle1> create table counter (what varchar(5), id integer, count
integer, primary key (what, id));
drizzle1> insert into t1 values (1,1);
drizzle1> set tx_isolation='READ-COMMITTED';
drizzle1> set autocommit=0;
drizzle2> set tx_isolation='READ-COMMITTED';
drizzle2> set autocommit=0;
drizzle1> update counter set count = 10 where what = 'total' and id = 0;
Query OK, 1 row affected (0 sec)
Rows matched: 1 Changed: 1 Warnings: 0
drizzle2> update counter set count = 12 where what = 'total' and id = 0;
Query OK, 0 rows affected (0 sec)
Rows matched: 0 Changed: 0 Warnings: 0
drizzle1> commit;
Query OK, 0 rows affected (0.07 sec)
drizzle2> commit;
Query OK, 0 rows affected (0.07 sec)
drizzle2> select * from counter\G
*************************** 1. row ***************************
what: total
id: 0
count: 10
1 row in set (0 sec)
So the _first_ update is commited and the second update is basically
ignored silently. This is quite bad in my opinion.
The new behaviour in MySQL is drizzle2's update now locks, which appears
to be the intended behaviour all along. If it could be made so that it
doesn't lock and the last commit is the one that is written that would
be really cool.
Kind Regards
--
Andrew Hutchings - LinuxJedi - http://www.linuxjedi.co.uk/
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp