<div>Hi Atul,</div>
<div> </div>
<div>Thanks, I appreciate your help.  I apologize for not being clearer about my intent.  The goal is to implement a fault-tolerant pair of application component instances in a hot-warm configuration where the primary and secondary instances exchange heartbeats to determine the health/availability of their partner.  The partners would be on different nodes.  While the primary instance is running it should have exclusive write access to the application state.  If the configured number of heratbeats are missed, the secondary component instance will try to retrieve the lock on the application state (thereby becoming primary).  Given that networks are often unreliable the design goal is that the clustered file system should ensure that the secondary instance does not assume primary role while the actual primary instance is still alive when a network disruption has occurred.  So in a sense a controlled pingpong is actually the desired effect (where the secondary and primary instances change roles whenever the current primary instance fails).  Am I correct that the configuration referenced below could support this behavior?</div>

<div> </div>
<div>Thanks again for your help and your patience!</div>
<div> </div>
<div>Nochum<br><br></div>
<div class="gmail_quote">On Sun, Jan 10, 2010 at 10:30 PM, Atul Vidwansa <span dir="ltr"><<a href="mailto:Atul.Vidwansa@sun.com">Atul.Vidwansa@sun.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im">Comments inline...<br><br>Nochum Klein wrote:<br></div>
<div class="im">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi Atul,<br><br>Thanks a lot -- this is very helpful!<br><br>So assuming the application is performing the following fcntl() call to set a file segment lock:<br>
<br>   struct flock fl;<br>   int err;<br><br>   fl.l_type = F_WRLCK;<br>   fl.l_whence = 0;<br>   fl.l_start = 0;<br>   fl.l_len = 0;    /* len = 0 means until end of file */<br><br>   err = fcntl(file, F_SETLK, &fl);<br>
<br>I should be able to achieve the desired behavior<br><br></blockquote></div>What is your desired behavior ? 
<div class="im"><br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>if I enable cluster-wide locking with the /-o flock/ mount option.  Is this correct?<br><br></blockquote>
</div>Is your application writing to same file from multiple nodes? If yes, do writes from different nodes overlap? Above piece of code will work fine if each node is writing to its own file OR multiple nodes are writing to different sections of the file. Otherwise, it will result in lock pingpong.<br>
<br>Cheers,<br>_Atul<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div class="im"><br>Thanks again!<br><br>Nochum<br><br>---------- Original message ----------<br></div>
<div>
<div></div>
<div class="h5">From: Atul Vidwansa <Atul.Vidwa...@Sun.COM <mailto:<a href="mailto:Atul.Vidwa...@Sun.COM" target="_blank">Atul.Vidwa...@Sun.COM</a>>><br>Date: Jan 8, 1:30 am<br>Subject: Newbie question: File locking, synchronicity, order, and ownership<br>
To: lustre-discuss-list<br><br><br>Some comments inline..<br><br> <br> <br>Nochum Klein wrote:<br>> Hi Everyone,<br><br>> Apologies for what is likely a simple question for anyone who has been<br>> working with Lustre for a while.  I am evaluating Lustre as part of a<br>
> fault-tolerant failover solution for an application component.  Based<br>> on our design using heartbeats between the hot primary and warm<br>> secondary components, we have four basic requirements of the clustered<br>
> file system:<br><br>>    1. *Write Order *- The storage solution must write data blocks to<br>>       shared storage in the same order as they occur in the data<br>>       buffer.  Solutions that write data blocks in any other order<br>
>       (for example, to enhance disk efficiency) do not satisfy this<br>>       requirement.<br>>    2.  *Synchronous Write Persistence* - Upon return from a<br>>       synchronous write call, the storage solution guarantees that all<br>
>       the data have been written to durable, persistent storage.<br>>    3.  *Distributed File Locking* - Application components must be<br>>       able to request and obtain an exclusive lock on the shared<br>
>       storage. The storage solution must not assign the locks to two<br>>       servers simultaneously.<br><br></div></div>AFAIK Lustre does support distributed locking. From <a href="http://wiki.lustre.org/" target="_blank">wiki.lustre.org</a> <<a href="http://wiki.lustre.org/" target="_blank">http://wiki.lustre.org</a>>: 
<div class="im"><br><br>   * /flock/lockf/<br><br>   POSIX and BSD /flock/lockf/ system calls will be completely coherent<br>   across the cluster, using the Lustre lock manager, but are not<br>   enabled by default today. It is possible to enable client-local<br>
   /flock/ locking with the /-o localflock/ mount option, or<br>   cluster-wide locking with the /-o flock/ mount option. If/when this<br>   becomes the default, it is also possible to disable /flock/ for a<br>   client with the /-o noflock/ mount option.<br>
<br>>    1.  *Unique Write Ownership* - The application component that has<br>>       the file lock must be the only server process that can write to<br>>       the file. Once the system transfers the lock to another server,<br>
>       pending writes queued by the previous owner must fail.<br><br>It depends on what level of locking you do. Lustre supports byte-range<br>locking, so unless writes overlap, multiple writers can write to same file.<br>
<br>Cheers,<br>_Atul<br><br> <br> <br> <br>>   1.<br><br>> Can anyone confirm that these requirements would be met by Lustre 1.8?<br><br>> Thanks a lot!<br><br>> Nochum<br>> ------------------------------------------------------------------------<br>
<br>> _______________________________________________<br>> Lustre-discuss mailing list<br></div>> <a href="mailto:Lustre-disc...@lists.lustre.org" target="_blank">Lustre-disc...@lists.lustre.org</a> <mailto:<a href="mailto:Lustre-disc...@lists.lustre.org" target="_blank">Lustre-disc...@lists.lustre.org</a>> 
<div class="im"><br>><a href="http://lists.lustre.org/mailman/listinfo/lustre-discuss" target="_blank">http://lists.lustre.org/mailman/listinfo/lustre-discuss</a><br><br>_______________________________________________<br>
Lustre-discuss mailing list<br></div>Lustre-disc...@lists.lustre.orghttp://<a href="http://lists.lustre.org/mailman/listinfo/lustre-discuss" target="_blank">lists.lustre.org/mailman/listinfo/lustre-discuss</a> <mailto:Lustre-disc...@lists.lustre.orghttp://<a href="http://lists.lustre.org/mailman/listinfo/lustre-discuss" target="_blank">lists.lustre.org/mailman/listinfo/lustre-discuss</a>><br>
<br>------------------------------------------------------------------------<br><br>_______________________________________________<br>Lustre-discuss mailing list<br><a href="mailto:Lustre-discuss@lists.lustre.org" target="_blank">Lustre-discuss@lists.lustre.org</a> 
<div class="im"><br><a href="http://lists.lustre.org/mailman/listinfo/lustre-discuss" target="_blank">http://lists.lustre.org/mailman/listinfo/lustre-discuss</a><br> <br></div></blockquote><br></blockquote></div><br>