List:Internals« Previous MessageNext Message »
From:Vasil Dimov Date:February 9 2009 7:50pm
Subject:Re: innodb_flush_method
View as plain text  
On Wed, Feb 04, 2009 at 15:01:51 -0800, Ivan Novick wrote:
> > -----Original Message-----
> > From: MARK CALLAGHAN [mailto:mdcallag@stripped]
> > Sent: Wednesday, February 04, 2009 2:46 PM
> > To: Ivan Novick
> > Cc: internals@stripped
> > Subject: Re: innodb_flush_method
> > 
> > Innodb calls fsync in os_file_flush() which does not reference
> > UNIV_DO_FLUSH. os_file_flush() is called from fil_flush to try to
> > fsync. Whether fsync is done is determined by the value of the my.cnf
> > parameter innodb_flush_method and os_file_flush() looks at variables
> > derived from that to figure out what to do.
> 
> Yeah but the calls to os_file_flush in both os_file_pwrite and os_file_write
> are surrounded by #ifdef UNIV_DO_FLUSH
> 
> It seems that these are the 2 most standard cases of calling os_file_flush
> and they are essentially dead code due to the UNIV_DO_FLUSH
> 
> Is it right?

Ivan,

InnoDB does fsync() with every write by default. The typical code path
for this is buf_flush_buffered_writes() -> fil_flush_file_spaces() ->
fil_flush() -> os_file_flush().

-- 
Vasil Dimov
moc.elcaro@stripped        Software Developer @ Oracle/Innobase Oy
gro.DSBeerF@dv                Committer @ FreeBSD.org
gro.d5v@dv                    Home @ Sofia, Bulgaria

Attachment: [application/pgp-signature]
Thread
innodb_flush_methodIvan Novick4 Feb
  • Re: innodb_flush_methodMARK CALLAGHAN4 Feb
    • RE: innodb_flush_methodIvan Novick5 Feb
      • Re: innodb_flush_methodVasil Dimov9 Feb
        • RE: innodb_flush_methodIvan Novick10 Feb