← Back to team overview

maria-developers team mailing list archive

Re: Rev 3712: MDEV-4338 : Support atomic option on directFS/FusionIO

 


> -----Original Message-----
> From: Sergei Golubchik [mailto:serg@xxxxxxxxxxxx]
> Sent: Donnerstag, 4. April 2013 17:32
> To: maria-developers@xxxxxxxxxxxxxxxxxxx
> Cc: wlad@xxxxxxxxxxx
> Subject: Rev 3712: MDEV-4338 : Support atomic option on directFS/FusionIO

Hi Serg,

> Hi, Vladislav!
> 
> > +        srv_use_atomic_writes = (ibool) innobase_use_atomic_writes;
> 
> Is that the typical usage pattern in the innodb code?
> Because it looks a bit silly to me, why couldn't you create a sysvar
> directly on srv_use_atomic_writes, why an intermediate
> innobase_use_atomic_writes variable?

Yes, this is typical usage pattern in Innodb. Bit weird, I agree.  Every
innobase_xxx variable has an srv_xxx counterpart.  I have no clue why it is
so, but I did not want to disturb their existing conventions:)

 
<skip>

> it'd be nice if you could try os_file_set_atomic_writes() here to see if
> that works. This function creates and opens quite a few files, you could
> use one of them to mark it for atomic writes, and if that would fail,
> you'd disable atomic writes, and wouldn't change
> innobase_file_flush_method and innobase_use_doublewrite.

It is tricky to do it before files are opened the first time , without
moving lot of code around - there is non-trivial parsing of tablespace names
later on in open_or_create_data_files(), just to figure out directories and
filenames.

On the other hand, I think it is acceptable  to fail fast during start, as
long as option is not default, and good diagnostics are written into  error
log . look into error log, reset parameter to default. Currently there is a
single filesystem with atomic capability, so people who use
innodb_use_atomic_writes will probably know what they are doing. If/once
the option becomes popular so it makes sense to make it default, then I
would agree with you, a detection/fallback  is very appropriate.


> Btw, why not to use posix_fallocate whenever it's available?
> Or, at least, with its own --innodb-use-fallocate option?

Yes, I guess it (the new option) is a good idea.  I created a followup patch
that introduces the option
http://lists.askmonty.org/pipermail/commits/2013-April/004569.html . I set
default to ON.  What do you think?

Thanks a lot  for looking at the patch,
Wlad





Follow ups

References