← Back to team overview

maria-developers team mailing list archive

Re: commit performance when the binlog is enabled

 

Hi, Paul!

On Dec 29, Paul McCullagh wrote:
> On Dec 26, 2009, at 3:40 AM, MARK CALLAGHAN wrote:
>
>> * InnoDB locks prepare_commit_mutex in the prepare step
>
> What is the purpose of this lock?

As far as I understand (disclaimer!), it's purpose is to ensure that
commit records in the InnoDB transactional log are written in the same
order as Xid events in the binlog.

And the only reason for enforcing this order - as far as I understand -
is innodb hotbackup. It reads InnoDB logs (as files) and grabs a copy of
the binlog. And after recovery all data must be consistent. If binlog
contains more transactions that innodb logs, it's no problem - binlog
can be truncated. But at no point binlog can have *less* transactions.

If prepare_commit_mutex is removed, I can create an ordering of commits
where innodb log *always* has committed transactions that are not in a
binlog.

Regards / Mit vielen Grüßen,
Sergei

P.S. Disclaimer: besides the last statement everything else is just my
speculation about how innodb hot backup works.

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@xxxxxxx>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring



Follow ups

References