Whamcloud - gitweb
38a28107afef14f0d028d0b7927855f3a702388f
[doc/protocol.git] / mgs_connect.txt
1 RPC 250: MGS CONNECT - Client connection to an MGS
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 [[mgs-connect-rpc]]
4
5 .MGS_CONNECT Generic Packet Structure
6 image::mgs-connect-generic.png["MGS_CONNECT Generic Packet Structure",height=100]
7
8 //////////////////////////////////////////////////////////////////////
9 The mgs-connect-generic.png diagram resembles this text art:
10
11        MGS_CONNECT:
12       --request--------------------------------------------
13       | ptlrpc_body | obd_uuid | obd_uuid | lustre_handle |
14       -----------------------------------------------------
15       |  obd_connect_data |
16       ---------------------
17       --reply---------------------------
18       | ptlrpc_body | obd_connect_data |
19       ----------------------------------
20 //////////////////////////////////////////////////////////////////////
21
22 'ptlrpc_body'::
23 RPC descriptor.
24
25 'obd_uuid'::
26 UUIDs of the target (first) and client (second) entities. See
27 <<struct-obd-uuid>>.
28
29 'lustre_handle'::
30 See <<struct-lustre-handle>>.
31
32 'obd_connect_data'::
33 See <<struct-obd-connect-data>>.
34
35 The target UUID is just "MGS", and the client UUID is set to the
36 32byte string it gets from ... where?
37
38 The 'struct lustre_handle' (the fourth buffer in the message) has its
39 cookie set to .. what? It is set, but where does it come from?
40
41 The 'ocd_connect_flags' field is set to (fixme: what?) reflecting the
42 capabilities appropriate to the client. The 'ocd_brw_size' is set to the
43 largest value for the size of an RPC that the client can handle. The
44 'ocd_ibits_known' and 'ocd_checksum_types' values are set to what the client
45 considers appropriate. Other fields in the descriptor and
46 'obd_connect_data' structures are zero.
47
48 Once the server receives the 'obd_connect_client' message on behalf of
49 the given target it replies with an 'obd_connect_server' message. In
50 that message the server sends the 'pb__handle' to uniquely
51 identify the connection for subsequent communication. The client notes
52 that handle in its import for the given target.
53
54 fixme: Are there circumstances that could lead to the 'status'
55 value in the reply being non-zero? What would lead to that and what
56 error values would result?
57
58 The target maintains the last committed transaction for a client in
59 its export for that client. If this is the first connection, then that
60 last transaction value would just be zero. If there were previous
61 transactions for the client, then the transaction number for the last
62 such committed transaction is put in the 'pb_last_committed' field.
63
64 In a connection request the operation is not file system modifying, so
65 the 'pb_transno' value will be zero in the reply as well.