[Lustre-devel] Query to understand the Lustre request/reply message

Alexey Lyashkov alexey.lyashkov at clusterstor.com
Wed Oct 13 00:27:55 PDT 2010


eh.. Nicolas,

Format for messages which want to reconstructed after resend and don't want recontructed - is different.

As quick example it is OPEN request (via MDS_REINT command), 
that type message need a have extra buffer to store LOV EA, which to be send to MDS in replay case (with additional flag in header).
(client have a copy data from a mds reply after ptlrpc finish processing request).
That is why i say about "Reconstruct/replay case"

Also format is different is you want to use MDS_REINT + sub commands or you want to use something similar to MDS_SET_INFO.
For MDS_SET_INFO you use single format for all messages (just simple key <> value) buffer,
but for MDS_REINT you need two formats - one for generic MDS_REINT code (get opcode from command, get locks, and possible other)
and own format for each opcode  - such as open, unlink, setxattr, setattr.
all of them have a different number of buffers (fields).


On Oct 13, 2010, at 10:12, Nicolas Williams wrote:

> On Wed, Oct 13, 2010 at 09:25:00AM +0300, Alexey Lyashkov wrote:
>> 
>> On Oct 13, 2010, at 08:42, Nicolas Williams wrote:
>>> 
>>> 
>>> - add handlers for the new RPC to mdt_handler.c (for the MDS) or
>>>  ost_handler.c (for the OST), and so on
>>> 
>>>  The handlers are responsible for knowing which buffers contain what,
>>>  and for swabbing them.  You have to make sure that you don't swab a
>>>  buffer more than once.
>>> 
>> BTW.
>> That not enough.
>> Some of operations wants to have own recostructors for replay/resend.
> 
> I glossed over replay/resend, mostly because I know little about them,
> but also because they are completely orthogonal to the message format
> details.  If you want to add an RPC then the first step should be to get
> the RPC format designed and surrounding code up and running, then you
> can take care of replay/resend.
> 
>> Some of operations want to have a return lock - as example MDS_GETATTR
>> and MDS_REINT commands.
> 
> That too is orthogonal to the message formats.  The message format has
> to have a buffer (field) declared to carry lock (or capability, or
> whatever) bits, and some function has to be invoked to populate the
> buffer in the reply.
> 
> Nico
> -- 




More information about the lustre-devel mailing list