Re: purpose of thd_mark_transaction_to_rollback

Zardosht Kasheff <[email protected]> Wed, 20 Jun 2012 13:22:50 -0400
Newsgroups gmane.comp.db.mysql.devel
Message-ID <CABFd+SGcgjj87gZzREo6OuMx0Ryp8us1Qz4Bom0ctZgBHsw_Sw@mail.gmail.com>
Hello Dmitry,

Thank you for your response. Why does InnoDB do this when a deadlock
is detected? Does every storage engine need to do this? Is this part
of some specification that calls for this? Or is it some sort of
performance optimization?

Thanks
-Zardosht

On Tue, Jun 19, 2012 at 3:53 PM, Dmitry Lenev <[email protected]> wrote:
> Hello Zardosht!
>
> * Zardosht Kasheff <[email protected]> [12/06/19 22:20]:
>> Hello all,
>>
>> What is the purpose of thd_mark_transaction_to_rollback?
>
> This call allows storage engine to request a transaction/statement
> rollback from SQL-layer.
>
> For example, when InnoDB storage engine detects a deadlock it rolls
> back the transaction inside storage engine (i.e. itself), but it still
> needs to invoke this method so transaction is properly rolled back
> in other storage engines (including binary log).
>
>> Under what conditions is a storage engine required to call this function?
>
> See above. I guess it is good idea to call this method when your
> storage engine decides to initiate a transaction rollback because
> of internal reasons, i.e. in case when such a rollback is not
> explicitly initiated from SQL-layer.
>
> Hope this helps!
>
> --
> Dmitry Lenev, Software Developer
> Oracle Development SPB/MySQL, www.mysql.com
>
> Are you MySQL certified?  http://www.mysql.com/certification

-- 
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe:    http://lists.mysql.com/internals