On 2011-02-14, at 14:52, vilobh meshram wrote:> I have following three queries.Can you please help me? > 1) Does the metadata information which the Client gets from the MDS contain some fields which are updated at the client side and later are needed to the updated to the MDS to keep the information syncronized ?Currently this is not the case in either 1.8 or 2.x. There is some lazy effort to update the file size on the MDS when files are closed, but this is only on a "best effort" basis. There is a project (currently on hold) called "Size On MDS" (SOM) which stores the file size, blocks, etc on the MDS in a reliable manner, but it is fairly complex and has not been landed to any release branch yet.> 2) Or is it like the information which the MDS send to the Client when the file is open or created is a staic information like lock handle , how the file is striped, which OSS to use to write the file etc i.e. the Client does not modify the information provided by MDS ?This is a more correct statement for Lustre today. The file layout is static, though at some time in the near future (when HSM code is landed). The file layout could be revoked by the MDS if it needs to be changed (e.g. if the file data is being purged for HSM, or for a feature like file migration or data replication).> 3) Who maintain or keeps the updated information about the file size ? > i) OSS [I think its OSS] > ii) Client [Does Client cache the file size information ?] > iii) MDS [ Because whenever I open a new file or same file MDS shows file size=0]The OST keeps track of the size of each object stored there. The MDS contains the file layout (i.e. mapping of objects to file offsets). The client (LOV) is the place where this information is combined to determine the actual file size, based on the individual object sizes and the layout. The file size is cached on the client under DLM locks (one for each object in the file, and in the future one for the layout). Cheers, Andreas -- Andreas Dilger Principal Engineer Whamcloud, Inc.
Thanks Andreas for the reply. I also want to clarify one more thing is for each access to the file the MDS return a new lock handle i.e. if Client 1 opens the file /abc.txt (where / is the mountpoint for Lustre) and then Client 2 opens the same file /abc.txt (the lock handle returned by MDS to Client 1) to open /abc.txt != (the lock handle returned by MDS to Client2) to open /abc.txt i.e there is no sharing of lock handles between the Clients accessing the same file. Is my understanding correct? Thanks, Vilobh On Mon, Feb 14, 2011 at 6:11 PM, Andreas Dilger <adilger at whamcloud.com> wrote: On 2011-02-14, at 14:52, vilobh meshram wrote:> I have following three queries.Can you please help me? > 1) Does the metadata information which the Client gets from the MDS contain some fields which are updated at the client side and later are needed to the updated to the MDS to keep the information syncronized ?Currently this is not the case in either 1.8 or 2.x. There is some lazy effort to update the file size on the MDS when files are closed, but this is only on a "best effort" basis. There is a project (currently on hold) called "Size On MDS" (SOM) which stores the file size, blocks, etc on the MDS in a reliable manner, but it is fairly complex and has not been landed to any release branch yet.> 2) Or is it like the information which the MDS send to the Client when the file is open or created is a staic information like lock handle , how the file is striped, which OSS to use to write the file etc i.e. the Client does not modify the information provided by MDS ?This is a more correct statement for Lustre today. The file layout is static, though at some time in the near future (when HSM code is landed). The file layout could be revoked by the MDS if it needs to be changed (e.g. if the file data is being purged for HSM, or for a feature like file migration or data replication).> 3) Who maintain or keeps the updated information about the file size ? > i) OSS [I think its OSS] > ii) Client [Does Client cache the file size information ?] > iii) MDS [ Because whenever I open a new file or same file MDS shows file size=0]The OST keeps track of the size of each object stored there. The MDS contains the file layout (i.e. mapping of objects to file offsets). The client (LOV) is the place where this information is combined to determine the actual file size, based on the individual object sizes and the layout. The file size is cached on the client under DLM locks (one for each object in the file, and in the future one for the layout). Cheers, Andreas -- Andreas Dilger Principal Engineer Whamcloud, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.lustre.org/pipermail/lustre-discuss/attachments/20110214/feea35bc/attachment.html
On 2011-02-14, at 16:29, vilobh meshram wrote:> I also want to clarify one more thing is for each access to the file the MDS return a new lock handle i.e. if Client 1 opens the file /abc.txt (where / is the mountpoint for Lustre) and then Client 2 opens the same file /abc.txt > > (the lock handle returned by MDS to Client 1) to open /abc.txt != (the lock handle returned by MDS to Client2) to open /abc.txt > > i.e there is no sharing of lock handles between the Clients accessing the same file. > > Is my understanding correct?Correct. The lock handles are unique per client, per export. Note that multiple threads on the same client might share the same DLM lock, but the serialization should be handled internally by the Linux VFS already for local filesystems.> On Mon, Feb 14, 2011 at 6:11 PM, Andreas Dilger <adilger at whamcloud.com> wrote: > On 2011-02-14, at 14:52, vilobh meshram wrote: > > I have following three queries.Can you please help me? > > 1) Does the metadata information which the Client gets from the MDS contain some fields which are updated at the client side and later are needed to the updated to the MDS to keep the information syncronized ? > > Currently this is not the case in either 1.8 or 2.x. There is some lazy effort to update the file size on the MDS when files are closed, but this is only on a "best effort" basis. There is a project (currently on hold) called "Size On MDS" (SOM) which stores the file size, blocks, etc on the MDS in a reliable manner, but it is fairly complex and has not been landed to any release branch yet. > > > 2) Or is it like the information which the MDS send to the Client when the file is open or created is a staic information like lock handle , how the file is striped, which OSS to use to write the file etc i.e. the Client does not modify the information provided by MDS ? > > This is a more correct statement for Lustre today. The file layout is static, though at some time in the near future (when HSM code is landed). The file layout could be revoked by the MDS if it needs to be changed (e.g. if the file data is being purged for HSM, or for a feature like file migration or data replication). > > > 3) Who maintain or keeps the updated information about the file size ? > > i) OSS [I think its OSS] > > ii) Client [Does Client cache the file size information ?] > > iii) MDS [ Because whenever I open a new file or same file MDS shows file size=0] > > The OST keeps track of the size of each object stored there. The MDS contains the file layout (i.e. mapping of objects to file offsets). The client (LOV) is the place where this information is combined to determine the actual file size, based on the individual object sizes and the layout. > > The file size is cached on the client under DLM locks (one for each object in the file, and in the future one for the layout). > > Cheers, Andreas > -- > Andreas Dilger > Principal Engineer > Whamcloud, Inc. > > > >Cheers, Andreas -- Andreas Dilger Principal Engineer Whamcloud, Inc.