This is an idea I came across at the MySQL UC last week: How many applications handle failing COMMITs correctly ? And how can we test it ?
COMMITs can fail. The most simple case are deadlocks. The sad side of deadlocks is that they only happen under real load when you application creates concurrency against the same rows. That's usually hard to create in test-setups.
With MySQL Proxy you can create deadlocks easily. Well, more or less.
You can at least fake them nicely and let the application and server think that we have a deadlock. The trick is:
To make it a bit more interesting you don't have to let all the COMMITs fail. Just let 50% of them fail.
--[[ Let a random number of transaction rollback As part of the QA we have to verify that applications handle rollbacks nicely. To simulate a deadlock we turn client-side COMMITs into server-side ROLLBACKs and return a ERROR packet to the client telling it a …[Read more]