Re: Off Topic- Architectural Question..

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

 



On 10/22/2016 03:13 PM, bruce wrote:

> I've thought of having a "pid" file on the nfs, where each clientApp
> would reset/lock/use the pidFile to then get/use/delete the file as
> required, but this seems tb slow.. but doable.

I would experiment with using the atomicity of the filesystem rename.

The process on client number N will do:

1) list files in directory
2) identify a filename not starting with "INPROGRESS-" (e.g. "abcd"); if file-not-found {sleep(something); goto 1}
3) rename "abcd" to "INPROGRESS-N-abcd"; if file-not-found goto 2
4) process INPROGRESS-N-abcd
5) delete INPROGRESS-N-abcd
6) goto 1

The rename is atomic, so if two processes try to grab the same file, only one wins
the race; when a file has been renamed, nobody else can mess with it.

The good part is that you do not need anything running on the server.

Of course you have some tunables; sleep could be 0.01s or 1m, depending
on your expectations; "INPROGRESS-" could be a smarter Unicode prefix,
for example "⚒".

(alternatively, keep the name unchanged but rename the file away to
a client-specific directory)

Just be sure that rename maintains the atomicity for the NFS implementation
and version you are using.


Regards.
-- 
   Roberto Ragusa    mail at robertoragusa.it
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux