Re: Making metadata storage SQL-driven



Alexander Larsson wrote:
On Thu, 2005-09-01 at 13:47 +0100, Jamie McCracken wrote:

Alexander Larsson wrote:


Requiring such a setup is pretty demanding, for the conceptually trivial
thing of having two personal desktop machines. We all know this won't
happen at most places.


Well the only other thing I can think of is to use external lock files which are opened with O_CREAT and O_EXCL to serialise access in a multisession environment. Will that be atomic on NFS?


Locking over NFS is handled by a separate protocol and daemon (lockd).
We tried to use that in gconf, but apparently NFS locking is just
totally broken on too many systems for it to work.

yes though how does gconf solve this (or is it single session only)?

I also read the following as a work around on NFS:

"O_EXCL is broken on NFS file systems, programs which rely on it for performing locking tasks will contain a race condition. The solution for performing atomic file locking using a lockfile is to create a unique file on the same fs (e.g., incorporating hostname and pid), use link(2) to make a link to the lockfile. If link() returns 0, the lock is successful. Otherwise, use stat(2) on the unique file to check if its link count has increased to 2, in which case the lock is also successful."


--
Mr Jamie McCracken
http://www.advogato.org/person/jamiemcc/



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