Whamcloud - gitweb
LUDOC-296 protocol: Reorganize the document ot be top-down
[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 (250)
6 [options="header"]
7 |====
8 | request            | reply
9 | obd_connect_client | obd_connect_server
10 |====
11
12 When a client initiates a connection to the MGS,
13 it does so by sending an 'obd_connect_client' message and awaiting the
14 reply from the MGS of an 'obd_connect_server' message. This is the
15 first operation carried out by a client upon the issue of a 'mount'
16 command, and the target UUID is provided on the command line.
17
18 The target UUID is just "MGS", and the client UUID is set to the
19 32byte string it gets from ... where?
20
21 The 'struct lustre_handle' (the fourth buffer in the message) has its
22 cookie set to .. what? It is set, but where does it come from?
23
24 The 'ocd_connect_flags' field is set to (fixme: what?) reflecting the
25 capabilities appropriate to the client. The 'ocd_brw_size' is set to the
26 largest value for the size of an RPC that the client can handle. The
27 'ocd_ibits_known' and 'ocd_checksum_types' values are set to what the client
28 considers appropriate. Other fields in the descriptor and
29 'obd_connect_data' structures are zero.
30
31 Once the server receives the 'obd_connect_client' message on behalf of
32 the given target it replies with an 'obd_connect_server' message. In
33 that message the server sends the 'pb__handle' to uniquely
34 identify the connection for subsequent communication. The client notes
35 that handle in its import for the given target.
36
37 fixme: Are there circumstances that could lead to the 'status'
38 value in the reply being non-zero? What would lead to that and what
39 error values would result?
40
41 The target maintains the last committed transaction for a client in
42 its export for that client. If this is the first connection, then that
43 last transaction value would just be zero. If there were previous
44 transactions for the client, then the transaction number for the last
45 such committed transaction is put in the 'pb_last_committed' field.
46
47 In a connection request the operation is not file system modifying, so
48 the 'pb_transno' value will be zero in the reply as well.