Re: Making metadata storage SQL-driven



On Thu, 2005-09-01 at 12:36 +0100, Jamie McCracken wrote:
> Alexander Larsson wrote:
> > On Thu, 2005-09-01 at 12:21 +0100, Jamie McCracken wrote:
> > 
> > 
> >>For instance the embedded mysql needs no set up and it will work out of 
> >>the box (its just a shared library) so installation and setup is a 
> >>non-issue. It has no locking issues as the INNODB stuff in mysql is 
> >>multi generational so readers and writers dont block each other and its 
> >>totally safe as a write generates a new copy of a record and the commit 
> >>on it is atomic so even of there's a power failure during a write 
> >>corruption will not occur to anything committed.
> > 
> > 
> > How does this work with shared NFS homedirs? Writes are not atomic there
> > the same way they are for local filesystems, so how could you make the
> > commit atomic.
> 
> I dont know the internal details of mysql but generally casue the 
> generation architecture is journalised a new write creates a copy of the 
> exisiting record which once completed will have a flag on the record to 
> indicate whether its committed or not. So once the user has written the 
> changes, the user will call commit to set that flag. If power failure 
> occurs the record will either be committed (the flag set) or not (in 
> which case that copy is discarded and lost forever). To benefit from 
> this forced writes need to be used.

This is all true for a local filesystem (well, given a journaling
filesystem to cleanly handle the power failure), however it doesn't seem
to apply to NFS. You can't atomically extend the file over NFS (to my
knowledge). Say the file is now 1000 bytes, if two separate machines
wants to extend the file at the same time they'll both send a "write
this block at offset 1000 packet to the NFS server. The last one to the
server wins I believe. So, updates will be atomic on each client box,
but not between different boxes.

It seems[1] that mysql does correctly handle one writer and multiple
read-only instances over NFS, but that doesn't cover this usecase.
Overall, mysql doesn't seem to be recommending the use of databases on
NFS[2] at all.


[1] http://lists.mysql.com/mysql/133
[2] http://dev.mysql.com/doc/mysql/en/multiple-servers.html


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a one-legged misogynist messiah She's a man-hating kleptomaniac opera 
singer living homeless in New York's sewers. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]